Check your status check twice.

Today a friend I hadn’t seen in two week came to me, eagerly wanting to try my game.

With a confident smile I handed him my tablet and started to talk about the android version, the updates I’ve made and all…
On his very first attempt he managed to find a glitch, and an invincibility one it was on top of that.

The glitch is simple to reproduce, while having no shield get hit by 2 bars at the same time and you’re invincible. Thankfully a glitch like this is simple enough to track. Here’s the faulty line of code if you’d like to have a go at it:

if global.shield = -1{
instance_destroy();

Getting hit by a bar renders a “global.shield -1“, if you don’t have a shield (shield = 0) it kills you. However if you get hit by two bars, it jumps straight to -2 and you never die.
“always expect the unexpected” couldn’t be more true, especially when working with code.
The fix is simple:

if global.shield < 0{
instance_destroy();

That way not matter how many bars hit you, it will take you down.
Lesson learnt, always check your status checks, especially when they deal with key elements in your game.

Once can never have too many testers,
Cheers to Simon the Glitch Finder.
Until then…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s