by_player flag on bump and delay flag on move

This commit is contained in:
2026-08-16 01:17:30 -05:00
parent 1fa47f6418
commit d9408a9012
15 changed files with 139 additions and 81 deletions
+7 -3
View File
@@ -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)
}
}