MaxLos
Member
Hihi,
So in my game Mayro is able to do a roll but I don't want you to be able to roll through enemies and stop if you would collide with them, unless your already colliding with them, which in that case roll through them, otherwise you'd just roll in place and that'd be weird lol
This is the collision check I'm currently doing:
It works if im not already colliding with an enemy, but if I am and try to roll backwards, the player will roll in place. Doesn't do this when I try to roll foward though. What should I do to fix this? Thanks
So in my game Mayro is able to do a roll but I don't want you to be able to roll through enemies and stop if you would collide with them, unless your already colliding with them, which in that case roll through them, otherwise you'd just roll in place and that'd be weird lol
This is the collision check I'm currently doing:
Code:
if (place_meeting(x+hsp,y,par_enemy))
{
if !(place_meeting(x,y,par_enemy)) and (sprite_index = spr_Mario_roll) or (sprite_index = spr_Mario_roll_backwards)
{
while (!place_meeting(x+sign(hsp),y,par_enemy))
{
x = x + sign(hsp);
}
hsp = 0;
}
}