Need Help animating the Player

S

SquashyShrubs

Guest
//Animations
if (!place_meeting(x, y + 1, oWall))
{
sprite_index = sPlayer_jump
image_speed = 0
if (sign(vsp) > 0) image_index = 1; else image_index = 0;
}
else
{
image_speed = 1;
if (hsp == 0)
{
sprite_index = sPlayer
}
else
{
sprite_index = sPlayer_run
}
}

I am trying to animate my player. When I run the game, it appears to make a "copy" of the player and the copy does the animation.

What am I doing wrong?
 

samspade

Member
//Animations
if (!place_meeting(x, y + 1, oWall))
{
sprite_index = sPlayer_jump
image_speed = 0
if (sign(vsp) > 0) image_index = 1; else image_index = 0;
}
else
{
image_speed = 1;
if (hsp == 0)
{
sprite_index = sPlayer
}
else
{
sprite_index = sPlayer_run
}
}

I am trying to animate my player. When I run the game, it appears to make a "copy" of the player and the copy does the animation.

What am I doing wrong?
This code looks fine and at the very least couldn't cause the problem you describe. You must have other code that is doing something. I would start by looking through your player object. Maybe commenting out portions of it a bit at a time until you locate the problem.
 

Vallo92

Member
Is this partr of code taken from the Step event?
Can you post the Draw event code? Probably the problem lies there.
 
Top