fix: canWalk

This commit is contained in:
Renge 2022-05-09 14:33:02 -04:00
parent 59a21f9536
commit cf1382cc66

View File

@ -22,7 +22,7 @@ export default abstract class EnemyState extends State {
canWalk() { canWalk() {
let collision = <AABB>this.owner.collisionShape; let collision = <AABB>this.owner.collisionShape;
let colrow = this.parent.tilemap.getColRowAt(collision.center.clone().add(new Vec2(this.parent.direction * (collision.hw+2)))); let colrow = this.parent.tilemap.getColRowAt(collision.center.clone().add(new Vec2(this.parent.direction * (collision.hw+2), (collision.hh+2-32))));
return !this.parent.tilemap.isTileCollidable(colrow.x, colrow.y) && this.parent.tilemap.isTileCollidable(colrow.x,colrow.y+1); return !this.parent.tilemap.isTileCollidable(colrow.x, colrow.y) && this.parent.tilemap.isTileCollidable(colrow.x,colrow.y+1);
} }