W
Wild_West
Guest
Code:
if not(attacking){ exit; }
else
//when you collide with the enemy
if(image_xscale == 1)
and(attacking == true)
and( collision_circle(x+sprite_width/2, y, 100, enemy_targeted, false, true) )
{ hspeed = -20; vspeed = -15; recoil = true;
if(image_xscale == -1)
and(attacking == true)
and( collision_circle(x-sprite_width-50, y, 100, enemy_targeted, false, true) )
{ hspeed = 20; vspeed = -15; recoil = true;
But there's this problem that keeps coming up when I USE the attack to hit enemies, sometimes the hits don't seem to register right because the sprite change for recoil after attacking doesn't happen or with a spinning enemy I have the player goes into his taking damage code instead of hitting the enemy effect code.
I haven't had any trouble using collision shapes except for trying to stop the player leaving a collision rectangle that an enemy creates but, issue for another day.
Can anybody tell me why this collision circle seems to be getting ignored randomly when I try to use it?
Here's what's supposed to happen to some enemies or objects that the player collides with while attacking is true
Code:
if(other.attacking){ vspeed = 30;}
else
{
with(other)
{
move_contact_all(direction, hspeed);
hspeed = 0;
x = xprevious;
vspeed = 5;
}
}