R
Reyniki
Guest
[EDIT] My previous concern was solved but now I'm kinda lost on how to make the enemy sprites stop spazzing out when they're overlapping with the player.
Dunno if any line of code would show the problem but here's the enemy's chase after the player code:
Dunno if any line of code would show the problem but here's the enemy's chase after the player code:
Code:
dir = sign(oPlayer.x - x);
h_sp = dir * 2;
//Player no longer in range
if (!collision_rectangle(x+aggro, y, x-aggro, y-128, oPlayer, false, false)) {
state = ENEMYSTATE.FREE;
}
//Attack
if (collision_rectangle(x-aggro/6, y, x-aggro/6, y-128, oPlayer, false, false)) {
state = ENEMYSTATE.ATTACK;
}
sprite_index = sRagnar_RunningR;
image_xscale = sign(h_sp);
Last edited by a moderator: