M
Mindaugas
Guest
Hello fellow programers. I'm a newbie, so this hopefully won't be a difficult one. Ok, so I'm going through Shawn Spaldings tutorial about ''powerups''. He uses a simple block which changes color and jumps higher for 5secs with this code in obj_powerup colision with the player event:
jumpspeed = jumpspeed_powerup;
sprite_index = spr_player_powerup;
alarm [0] = 300;
(and later changes back the sprite to ''spr_player'' in player's alarm0 event)
The problem is that I'm not using 2 simple one image different color block sprites. I have 4 different sprites which are:
spr_player_idle;
spr_player_running;
spr_player_idle_powerup;
spr_player_running_powerup.
idle ones consists of 18 images and the running ones consists of 8 images (idk if that matters)
my sprites are animated by Shawn's ''animation'' tutorial, with a code in player's step event which is:
if (move !=0) image_xscale = move;
if (place_meeting (x, y+1, obj_wall))
{{
if (move !=0) sprite_index = spr_player_running;
else sprite_index = spr_player_idle;
}
image_speed = 0.2}
(i thought that copying this into powerup's colision event with sprite names changed will be enough, unfortunately it wasn't)
jumpspeed = jumpspeed_powerup;
sprite_index = spr_player_powerup;
alarm [0] = 300;
(and later changes back the sprite to ''spr_player'' in player's alarm0 event)
The problem is that I'm not using 2 simple one image different color block sprites. I have 4 different sprites which are:
spr_player_idle;
spr_player_running;
spr_player_idle_powerup;
spr_player_running_powerup.
idle ones consists of 18 images and the running ones consists of 8 images (idk if that matters)
my sprites are animated by Shawn's ''animation'' tutorial, with a code in player's step event which is:
if (move !=0) image_xscale = move;
if (place_meeting (x, y+1, obj_wall))
{{
if (move !=0) sprite_index = spr_player_running;
else sprite_index = spr_player_idle;
}
image_speed = 0.2}
(i thought that copying this into powerup's colision event with sprite names changed will be enough, unfortunately it wasn't)