4
0
Fork 0

Suppression bug coincage dans les murs quand poussé par monstre

This commit is contained in:
rick 2020-12-05 23:04:52 +01:00
parent 000e34f223
commit f46c8e34ce

View file

@ -8,12 +8,13 @@ if (pdv <= 0) {
} }
// pushback // pushback
if (other.x > x) { knockback = 10;
x -= 10; if (other.x > x && !place_meeting(x-knockback-1, y, oWall)) {
} else if (other.x < x) { x -= knockback;
x += 10; } else if (other.x < x && !place_meeting(x+knockback+1, y, oWall)) {
} else if (other.y > y) { x += knockback;
y -= 10; } else if (other.y > y && !place_meeting(x, y-knockback-1, oWall)) {
} else if (other.y < y) { y -= knockback;
y += 10; } else if (other.y < y && !place_meeting(x, y+knockback+1, oWall)) {
y += knockback;
} }