[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 97973dd305 288/472: Rough implementaion of escapin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 97973dd305 288/472: Rough implementaion of escaping for TGs (#153) |
Date: |
Thu, 6 Jan 2022 21:59:32 -0500 (EST) |
branch: elpa/pacmacs
commit 97973dd305c006d368f9ebf0c7ee99457306b38d
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Rough implementaion of escaping for TGs (#153)
---
pacmacs-utils.el | 7 +++++++
pacmacs.el | 14 ++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/pacmacs-utils.el b/pacmacs-utils.el
index 2c14345a2f..f00b07a980 100644
--- a/pacmacs-utils.el
+++ b/pacmacs-utils.el
@@ -72,6 +72,13 @@ side-effects."
(cdr (assoc direction-vector
direction-table))))
+(defun pacmacs--opposite-direction-name (direction-name)
+ (cl-case direction-name
+ ('left 'right)
+ ('right 'left)
+ ('up 'down)
+ ('down 'up)))
+
(defun pacmacs--levelname-from-filename (filename)
(when (string-match "\\(map[0-9]+\\)\\.txt" filename)
(match-string 1 filename)))
diff --git a/pacmacs.el b/pacmacs.el
index e8aac93d96..439e8ec689 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -336,6 +336,13 @@
(let ((direction (pacmacs--cell-wrapped-get pacmacs--track-board row
column)))
(pacmacs--switch-direction game-object direction))))
+(defun pacmacs--back-track-object (game-object)
+ (plist-bind ((row :row)
+ (column :column))
+ game-object
+ (let ((direction (pacmacs--cell-wrapped-get pacmacs--track-board row
column)))
+ (pacmacs--switch-direction game-object (pacmacs--opposite-direction-name
direction)))))
+
(defun pacmacs-tick ()
(interactive)
@@ -358,6 +365,11 @@
(pacmacs--track-object ghost)
(pacmacs--step-object ghost)))
+(defun pacmacs--step-terrified-ghosts ()
+ (dolist (terrified-ghost pacmacs--terrified-ghosts)
+ (pacmacs--back-track-object terrified-ghost)
+ (pacmacs--step-object terrified-ghost)))
+
(defun pacmacs--detect-pill-collision ()
(plist-bind ((row :row)
(column :column))
@@ -378,6 +390,7 @@
(pacmacs--anim-object-next-frame pacmacs--player-state
pacmacs-tick-duration-ms)
(pacmacs--anim-object-list-next-frame pacmacs--ghosts
pacmacs-tick-duration-ms)
(pacmacs--anim-object-list-next-frame pacmacs--pills
pacmacs-tick-duration-ms)
+ (pacmacs--anim-object-list-next-frame pacmacs--terrified-ghosts
pacmacs-tick-duration-ms)
(pacmacs--recalc-track-board)
(if pacmacs--pills
@@ -388,6 +401,7 @@
(pacmacs--switch-to-death-state))
(pacmacs--detect-pill-collision)
(pacmacs--step-ghosts)
+ (pacmacs--step-terrified-ghosts)
(when (pacmacs--ghost-collision-p)
(dolist (ghost pacmacs--ghosts)
(pacmacs--step-back-object ghost))
- [nongnu] elpa/pacmacs 68f6dc9a93 167/472: Update MELPA repo link, (continued)
- [nongnu] elpa/pacmacs 68f6dc9a93 167/472: Update MELPA repo link, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fe837b20fa 184/472: Implement victory animation for ghosts. Close #89, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 09ad044887 232/472: Better color for walls (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9c69162781 247/472: Rough implementation of XPM wall generation (#141), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4a94a72dd4 250/472: Remove generate-wall-tiles script tool (#141), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs eab5b98b05 254/472: Add average-tick-time function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4bd94d2058 255/472: Merge branch 'master' into big-pills-81, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b97248f316 258/472: Put regular and big pills to same list (#81), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2473e65744 268/472: Remove dead left overs of #141, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 22355a4954 276/472: Add Terrified Ghost animation. Close #83, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 97973dd305 288/472: Rough implementaion of escaping for TGs (#153),
ELPA Syncer <=
- [nongnu] elpa/pacmacs 3758d601d3 304/472: Fix blinking terrified ghost animation, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 27c7ba7bbb 314/472: Update README about minimal version of Emacs (#165), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d6b63ef5b9 317/472: Merge pull request #166 from codingteam/drop-emacs-24.3-165, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 3344de1bbe 322/472: Adapt render-track-board for new track board, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 481eb8bd37 326/472: Merge pull request #169 from codingteam/distances-instead-of-directions-159, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 31d7305439 331/472: Add 2nd big pill level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 862f9b7f9e 332/472: Add 3d big pill level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 375d85e49b 344/472: Add pacmacs-replay-finished-hook, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ffc0195b9a 346/472: Merge pull request #176 from codingteam/refactor-it-recorder, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ebeba826ce 356/472: Merge pull request #180 from codingteam/headers-urls-178, ELPA Syncer, 2022/01/06