[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 00b3223066 305/472: Handle ghost bling threshold (
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 00b3223066 305/472: Handle ghost bling threshold (#159) |
Date: |
Thu, 6 Jan 2022 21:59:34 -0500 (EST) |
branch: elpa/pacmacs
commit 00b3223066e48e91e75bc20f3db79d96e0128046
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Handle ghost bling threshold (#159)
---
pacmacs.el | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/pacmacs.el b/pacmacs.el
index e0887ab881..553b2b64d0 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -49,6 +49,7 @@
(defconst pacmacs-buffer-name "*Pacmacs*")
(defconst pacmacs-tick-duration-ms 100)
+(defconst pacmacs--ghost-blinking-threshold 2500)
(defvar pacmacs-debug-output nil)
@@ -151,6 +152,17 @@
(cl-decf terrified-timer
pacmacs-tick-duration-ms)))))
+(defun pacmacs--handle-ghost-blinking-threshold ()
+ (dolist (terrified-ghost pacmacs--terrified-ghosts)
+ (plist-bind ((terrified-timer :terrified-timer))
+ terrified-ghost
+ (when (<= (- terrified-timer pacmacs-tick-duration-ms)
+ pacmacs--ghost-blinking-threshold
+ terrified-timer)
+ (plist-put terrified-ghost
+ :current-animation
+ (pacmacs-load-anim "Blinking-Terrified-Ghost"))))))
+
(defun pacmacs--switch-direction-animation-callback (animation-prefix)
(let ((direction-animations (-mapcat
(-lambda (direction)
@@ -475,7 +487,11 @@
(pacmacs--anim-object-list-next-frame pacmacs--terrified-ghosts
pacmacs-tick-duration-ms)
(pacmacs--recalc-track-board)
+
(pacmacs--unterrify-timed-out-ghosts)
+ (pacmacs--decrease-terrified-timers)
+ (pacmacs--handle-ghost-blinking-threshold)
+
(if pacmacs--pills
(progn
(pacmacs--step-object pacmacs--player-state)
@@ -487,7 +503,6 @@
(pacmacs--step-ghosts)
(pacmacs--step-terrified-ghosts)
(pacmacs--detect-terrified-ghost-collision)
- (pacmacs--decrease-terrified-timers)
(when (pacmacs--ghost-collision-p)
(dolist (ghost pacmacs--ghosts)
(pacmacs--step-back-object ghost))
- [nongnu] elpa/pacmacs 169cd54064 269/472: Add UT for pacmacs--bit-list-to-integer, (continued)
- [nongnu] elpa/pacmacs 169cd54064 269/472: Add UT for pacmacs--bit-list-to-integer, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 769414fae0 274/472: Extend pacmacs--normalize-wall-bits UT, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d8a7998192 277/472: Extract `cask install` to separate step in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 614a98ccc7 278/472: Cleanup README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fa6eca1731 284/472: Introduce list for terrified ghost objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 701da0f16c 285/472: Rename direction switching callbacks (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cfa4437107 292/472: Implement eating terrified ghosts (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ece3e76f30 296/472: Rename run-away-direction arguments (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 24ddb1b9ad 303/472: Merge pull request #160 from codingteam/terrified-ghost-state-153, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5cb14f20fd 301/472: UT for pacmacs--replace-game-objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 00b3223066 305/472: Handle ghost bling threshold (#159),
ELPA Syncer <=
- [nongnu] elpa/pacmacs d608708f15 311/472: UT for handle-ghost-blinking-threshold (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2297996e29 323/472: Smarter running away algorithm (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9b714e4678 321/472: Fix pacmacs--track-object UT (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 16a6ac7e98 327/472: UT for pacmacs--render-track-board, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 729de2de92 329/472: Remove big from the first level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 556098da2e 337/472: Put big pills level before w/o BP ones (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 151da84fdc 338/472: Remove replace-game-object function (#171), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c4c2fbfa6f 347/472: Merge branch 'master' into unterrified-original-possition-171, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9375a8a3e7 351/472: Merge branch 'master' into unterrified-original-possition-171, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 51a2ac25fe 354/472: Merge pull request #175 from codingteam/maps-with-big-pills-162, ELPA Syncer, 2022/01/06