• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Help creating an object

H

Hudsonius

Guest
So.. In my game I have a man that, when you get close enough to him, he turns into a werewolf. You get near to him, he flashes between man and werewolf, then becomes a werewolf and chases you down. Everything is working except, that, when you get near to the man, he turns into the first image of the flashing sprite and stays like that until you get out of his radius. Then he'll hunt you down as a werewolf, once you get into his radius again. I'd like him to change into a werewolf once you get near to him so please help me!

I have a picture of my stuffs
 

Attachments

Repix

Member
What you have to remember is that when he gets into the radius of 75 pixels.. He will keep resetting the sprite.

So just have a variable turn false when within that radius to avoid that happening. If variable is true, then set the sprite and turn that variable to false.
 

jo-thijs

Member
So.. In my game I have a man that, when you get close enough to him, he turns into a werewolf. You get near to him, he flashes between man and werewolf, then becomes a werewolf and chases you down. Everything is working except, that, when you get near to the man, he turns into the first image of the flashing sprite and stays like that until you get out of his radius. Then he'll hunt you down as a werewolf, once you get into his radius again. I'd like him to change into a werewolf once you get near to him so please help me!

I have a picture of my stuffs
Setting the sprite using DnD also resets the image_index, which is wat is keeping the flashing sprite at its first image.
Instead, try setting the sprite by setting the variable sprite_index to the name of your flashing sprite.

The need for getting back out of the radius to complete the transformation is due to you constantly resetting the alarm event.
You should only execute that block of DnD actions if the expression (alarm[11] < 0) is true.
 
H

Hudsonius

Guest
Setting the sprite using DnD also resets the image_index, which is wat is keeping the flashing sprite at its first image.
Instead, try setting the sprite by setting the variable sprite_index to the name of your flashing sprite.

The need for getting back out of the radius to complete the transformation is due to you constantly resetting the alarm event.
You should only execute that block of DnD actions if the expression (alarm[11] < 0) is true.
Thanks! This seems to be working fine!
 
Top