by_player flag on bump and delay flag on move
This commit is contained in:
@@ -3,7 +3,11 @@
|
||||
// A gem is a collectible: it is solid, so walking into it fires this `bump()`
|
||||
// hook. We bank the gem and `die()`, which clears the cell — so the move that
|
||||
// bumped us completes and the player ends up standing where the gem was.
|
||||
fn bump(me, _dir) {
|
||||
alter_gems(1);
|
||||
die();
|
||||
fn bump(me, dir, by_player) {
|
||||
if by_player {
|
||||
alter_gems(1);
|
||||
die();
|
||||
} else {
|
||||
move(dir.opposite, false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user