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
if (other.x > x) {
x -= 10;
} else if (other.x < x) {
x += 10;
} else if (other.y > y) {
y -= 10;
} else if (other.y < y) {
y += 10;
knockback = 10;
if (other.x > x && !place_meeting(x-knockback-1, y, oWall)) {
x -= knockback;
} else if (other.x < x && !place_meeting(x+knockback+1, y, oWall)) {
x += knockback;
} else if (other.y > y && !place_meeting(x, y-knockback-1, oWall)) {
y -= knockback;
} else if (other.y < y && !place_meeting(x, y+knockback+1, oWall)) {
y += knockback;
}