[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs e12ed88fe7 298/472: Generalize run-away-direction
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs e12ed88fe7 298/472: Generalize run-away-direction function (#153) |
Date: |
Thu, 6 Jan 2022 21:59:33 -0500 (EST) |
branch: elpa/pacmacs
commit e12ed88fe7c3d2da2c1c31d6f5346cd281e9c5e3
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Generalize run-away-direction function (#153)
Parametrize it with blocked-tile-predicate
---
pacmacs.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index faa3111f9e..8c4369139e 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -372,7 +372,7 @@
(pacmacs--track-object ghost)
(pacmacs--step-object ghost)))
-(defun pacmacs--run-away-direction (runner bogey)
+(defun pacmacs--run-away-direction (runner bogey blocked-tile-predicate)
(plist-bind ((runner-row :row)
(runner-column :column))
runner
@@ -384,7 +384,7 @@
(possible-ways
(->> (pacmacs--possible-side-ways runner-row runner-column)
(-remove (-lambda ((row . column))
- (or (pacmacs--wall-at-p row column)
+ (or (funcall blocked-tile-predicate row column)
(> current-distance
(pacmacs--squared-distance row column
bogey-row
bogey-column))))))))
@@ -396,7 +396,8 @@
(dolist (terrified-ghost pacmacs--terrified-ghosts)
(-when-let (direction (pacmacs--run-away-direction
terrified-ghost
- pacmacs--player-state))
+ pacmacs--player-state
+ #'pacmacs--wall-at-p))
(pacmacs--switch-direction terrified-ghost direction))
(pacmacs--step-object terrified-ghost)))
- [nongnu] elpa/pacmacs 63e41ffe23 169/472: Fix the dev workflow in the README, (continued)
- [nongnu] elpa/pacmacs 63e41ffe23 169/472: Fix the dev workflow in the README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9525cd168b 172/472: Update README about the pause feature, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 98599015bb 229/472: Fix UTs broken by #133 implementation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e294101a92 231/472: Fix Game Over sign for connected walls (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a7a4146732 234/472: Fix the wall corner gaps (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 528ca62e28 251/472: Merge branch 'drop-xbm-support-141'. Close #141, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7d58295e93 281/472: Fix pacmacs--render-score-table function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c501625be6 282/472: Add Blinking Terrified Ghost animation. Close #155, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs da727a84c1 287/472: Double dash play state logic function (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d49e28e468 293/472: Remove pacmacs--opposite-direction-name (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e12ed88fe7 298/472: Generalize run-away-direction function (#153),
ELPA Syncer <=
- [nongnu] elpa/pacmacs be52b6410f 294/472: UT for pacmacs--squared-distance (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0103a77462 302/472: Remove replace-filtered-game-objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ee76ee2dc0 299/472: UT for pacmacs--run-away-direction (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cec13dd618 308/472: Fix Emacs 24.3 build fail (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e662ec9be7 313/472: Disable Emacs 24.3 in the Travis build (#165), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fa83e10d82 325/472: Get rid of dup code in track object mech (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 51117fc5db 336/472: Rename 5th big pill level accordingly (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0a33c04fc1 333/472: Add fourth big pill level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 402d176003 339/472: Remove unused functions (#171), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 71b977fd22 343/472: Transform it-recorder.el to an additional module, ELPA Syncer, 2022/01/06