[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 99a90b9c87 125/472: Fix the tunneling effect. Clos
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 99a90b9c87 125/472: Fix the tunneling effect. Close #88 |
Date: |
Thu, 6 Jan 2022 21:59:18 -0500 (EST) |
branch: elpa/pacmacs
commit 99a90b9c87c02511dbc36cd05fa2798d14e39e26
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Fix the tunneling effect. Close #88
---
maps/map06.txt | 3 +++
pacmacs.el | 37 +++++++++++++++++++++++++------------
2 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/maps/map06.txt b/maps/map06.txt
new file mode 100644
index 0000000000..7febcfcead
--- /dev/null
+++ b/maps/map06.txt
@@ -0,0 +1,3 @@
+############
+#o g#
+############
diff --git a/pacmacs.el b/pacmacs.el
index 0bb23a78b6..ae9a1316e3 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -44,7 +44,8 @@
(defconst pacmacs-buffer-name "*Pacmacs*")
(defconst pacmacs-tick-duration-ms 100)
-(defconst pacmacs-debug-output nil)
+
+(defvar pacmacs-debug-output nil)
(defvar pacmacs-timer nil)
@@ -271,19 +272,12 @@
(erase-buffer)
(pacmacs-render-state))))
-(defun pacmacs-play-state-logic ()
- (pacmacs-anim-object-next-frame pacmacs-player-state
pacmacs-tick-duration-ms)
- (dolist (ghost pacmacs-ghosts)
- (pacmacs-anim-object-next-frame ghost pacmacs-tick-duration-ms))
- (dolist (pill pacmacs-pills)
- (pacmacs-anim-object-next-frame pill pacmacs-tick-duration-ms))
-
- (pacmacs-step-object pacmacs-player-state)
- (pacmacs--recalc-track-board)
+(defun pacmacs--step-ghosts ()
(dolist (ghost pacmacs-ghosts)
(pacmacs--track-object ghost)
- (pacmacs-step-object ghost))
+ (pacmacs-step-object ghost)))
+(defun pacmacs--detect-pill-collision ()
(plist-bind ((row :row)
(column :column))
pacmacs-player-state
@@ -296,11 +290,30 @@
pill
(and (= row p-row)
(= column p-column))))
- pacmacs-pills)))
+ pacmacs-pills)))))
+(defun pacmacs--detect-ghost-collision ()
+ (plist-bind ((row :row)
+ (column :column))
+ pacmacs-player-state
(-when-let (ghost (pacmacs--ghost-at-p row column))
(pacmacs--switch-to-death-state))))
+(defun pacmacs-play-state-logic ()
+ (pacmacs-anim-object-next-frame pacmacs-player-state
pacmacs-tick-duration-ms)
+ (dolist (ghost pacmacs-ghosts)
+ (pacmacs-anim-object-next-frame ghost pacmacs-tick-duration-ms))
+ (dolist (pill pacmacs-pills)
+ (pacmacs-anim-object-next-frame pill pacmacs-tick-duration-ms))
+
+ (pacmacs--recalc-track-board)
+ (pacmacs--detect-ghost-collision)
+ (when (equal pacmacs-game-state 'play)
+ (pacmacs-step-object pacmacs-player-state)
+ (pacmacs--detect-pill-collision)
+ (pacmacs--detect-ghost-collision)
+ (when (equal pacmacs-game-state 'play)
+ (pacmacs--step-ghosts))))
(defun pacmacs-death-state-logic ()
(pacmacs-anim-object-next-frame pacmacs-player-state
- [nongnu] elpa/pacmacs f79355209d 060/472: Refactor out functions for creating images (#51), (continued)
- [nongnu] elpa/pacmacs f79355209d 060/472: Refactor out functions for creating images (#51), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 080aae5f08 070/472: Use plist-bind for pacman-anim-next-frame function (#54), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1e1cebe39a 073/472: Introduce plist-map utility function (#54), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ba7ad0349d 082/472: Rename pacman to pacmacs. Close #66, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c447091a19 085/472: Fix description in the game headers, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e85c81b077 090/472: Enable entire code base for coverage (#70), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e3d914a1ea 097/472: Dropping support for Emacs 24.1 and 24.2. Close #71, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4b08605994 093/472: UTs for duration frame logic. Close #60, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c865fda214 120/472: Merge branch 'board-refactoring-74'. Close #74, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7e8970628c 122/472: Add sprites for Pacman Death animation. Close #44, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 99a90b9c87 125/472: Fix the tunneling effect. Close #88,
ELPA Syncer <=
- [nongnu] elpa/pacmacs d49cb4afe3 128/472: Fix misspelling of the word `life` in single form, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 22dd5e5cf9 133/472: Rename pacmacs--detect-ghost-collision function (#97), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d2cf3bd4ba 144/472: Fix hitting ghost visibility bug. Close #78, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5db26b2e3d 154/472: Make the Game Over sign even more smaller, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5b32c6f310 155/472: Package resources with Cask (#95), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs db03c57347 158/472: Add autoload cookie for pacmacs-start function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7285f61d45 164/472: Require pacmacs-board in the pacmacs-render module, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b00db2f7fa 240/472: Use hashmap for tile cache instead of vector (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 838833da41 414/472: Go to the beginning if score is not featured, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 75f7ddd459 418/472: Add UT for position-of-new-score func (#134), ELPA Syncer, 2022/01/06