• 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!

GML Help with a Variable Passed from a Collision to a Step Event

G

GeoffDev

Guest
Hello,

I am trying to check a variable in a step event which is set on a collision event.

My step event code in the player object obj_player_one:

if (PLAYERALIVE=0) {

sprite_index = spr_player_die;
image_speed = 0.60;
image_index = 0;
}


This in the enemy collision code:

PLAYERALIVE = 0;


I have also tried this in collision code:

object_set_sprite( obj_player_one, spr_player_die );
image_speed = 0.60;
image_index = 0;

These do not work. The sprite does not change. Any ideas why?

Regards,
Geoff
 
Top