boulders are pushed in the movement not facing direction (fixes #81)

This commit is contained in:
Timothy Stiles 2021-11-18 20:53:56 +11:00
parent a87db67d84
commit 8feb732a8f
2 changed files with 3 additions and 3 deletions

View File

@ -1618,7 +1618,7 @@ export class Level extends LevelInterface {
let original_name = tile.type.name;
// TODO check ignores here?
if (tile.type.on_bumped) {
tile.type.on_bumped(tile, this, actor);
tile.type.on_bumped(tile, this, actor, direction);
}
// Death happens here: if a monster or block even thinks about moving into a player, or

View File

@ -1226,10 +1226,10 @@ const TILE_TYPES = {
return null;
}
},
on_bumped(me, level, other) {
on_bumped(me, level, other, direction) {
if (other.type.name === 'boulder') {
level._set_tile_prop(me, 'rolling', true);
level._set_tile_prop(me, 'direction', other.direction);
level._set_tile_prop(me, 'direction', direction);
level._set_tile_prop(other, 'rolling', false);
}
},