animated enemy left right moving.
you jump on it to destroy.
The issue is , when colliding with the enemy the player only gets hurt from
the enemy facing you, when it is moving away (back facing) the player can
walk right up behind it without being hurt.
i have used my basic enemy collision code for a long time with no problems till now,
i have checked and rechecked back on my other games and i can be 'hurt' from
front and behind the enemy and my code is the same
i dont understand why i can only be hurt from one side of the enemy now ?
player collision with enemy
///you squash
if (vspeed > 0 && y < other.y + 8)
{
other.enemy_die=1;
sound_play(snd_galkdeath);
vspeed=-10;
score+=10;
with (other) instance_destroy();
}
else ///you hurt
{
sound_play(snd_playerhurt);
global.hearts-=1;
x=xstart;
y=ystart;
FaceDirection = 1
if (FaceDirection = 1)
{
sprite_index=spr_standright;
image_index=-1;
image_speed=0.2;
}
else
{
sprite_index=spr_standleft;
image_index=-1;
image_speed=0.2;
}
}



Find content
Male
