A
Alexander Olofsson
Guest
So, just have a look at my code:
That is in the STEP EVENT and the solution might be really simple, but I'm new to coding, and I can't really see why the problem occurs.. so, the problem is that the sprite_index equals spr_falling all the time, even when I am touching ground, and that if statement is not supposed to run if I'm not touching ground, and I really can't figure it out. I really need help.
I watched Shaun Spalding's platformer tutorial, in case that might be important.
Thanks in advance!
Code:
if(hsp != 0 && vsp = 0)
{
sprite_index = spr_player_running;
image_speed = 0.3;
} else {
sprite_index = spr_player;
}
if (vsp < 0 && !place_meeting(x,y,par_solids))
{
sprite_index = spr_jump;
} else {
sprite_index = spr_falling;
}
That is in the STEP EVENT and the solution might be really simple, but I'm new to coding, and I can't really see why the problem occurs.. so, the problem is that the sprite_index equals spr_falling all the time, even when I am touching ground, and that if statement is not supposed to run if I'm not touching ground, and I really can't figure it out. I really need help.
I watched Shaun Spalding's platformer tutorial, in case that might be important.
Thanks in advance!