P
Pedau666
Guest
I wanted to make armor for the player (boots and breastplate) but when I added this simple code to draw the sprite on the player it draws pretty ugly and most of the time it has other animation than the player has. Sprite for the boots has exactly the same amount of frames as player and each frame is drawn to fit the players sprite. Do you know how to fix this problem?
o_armor step event
In place of "s_what" I type the sprite I want to draw in create event and "what" is the object drawn.
o_armor step event
Code:
what.x = o_player.x;
what.y = o_player.y;
//animation
if(!place_meeting(x,y+1,o_solid))
{
sprite_index = s_what_jump;
image_speed = 0;
if(sign(o_player.vsp)>0) image_index = 1; else image_index = 0;
}
else
{
image_speed = 1;
if(o_player.hsp==0)
{
sprite_index = s_what;
}
else
{
sprite_index = s_what_run;
}
}
if(o_player.hsp != 0) image_xscale = sign(o_player.hsp);
//invincible
if o_player.inv > 0 {
o_player.inv -= 1;
}
if(o_player.hsp != 0) image_xscale = sign(o_player.hsp);