I
its_Johnny
Guest
hello everyone,
I am facing an issue on GameMaker Studio 2, regarding a sprite animation.
I have done several sprites for the hero (the character the player can use), one if the hero object dent move, one if for when the character uses the stairs. I have a problem with this exact sprite, the other 2 work fine and do the animation but not this one. I'm sorry if i'm not clear enough but I'm pretty new at coding. thanks for your help, here's the code I've written
I am facing an issue on GameMaker Studio 2, regarding a sprite animation.
I have done several sprites for the hero (the character the player can use), one if the hero object dent move, one if for when the character uses the stairs. I have a problem with this exact sprite, the other 2 work fine and do the animation but not this one. I'm sorry if i'm not clear enough but I'm pretty new at coding. thanks for your help, here's the code I've written
Code:
//stairs meeting
if (key_up || key_down)
{
if(place_meeting(x,y,o_stairs)) ladder = true;
}
if ladder = true
{
grv = 0;
if (key_up) vsp = -2;
if (key_down) vsp = +2;
if!place_meeting(x,y,o_stairs) ladder = false;
if (key_jump) ladder = false;
}
if ladder = false
{
grv = 0.25;
}
//Animation
if (keyboard_check(vk_left))
{
image_xscale = -0.1
}
if (keyboard_check(vk_right))
{
image_xscale = 0.1
}
if (hsp < 0)
{
sprite_index = S_player_run
}
if (hsp > 0)
{
sprite_index = S_player_run
}
if (hsp = 0)
{
sprite_index = S_player
}
if (place_meeting(x,y,o_stairs) && keyboard_check(vk_up))
{
sprite_index = S_Player_stairs;
image_speed = true;
}
if (place_meeting(x,y,o_stairs) && keyboard_check(vk_down))
{
sprite_index = S_Player_stairs;
image_speed = true;
}