emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs 9acb9eefa4 286/472: Introduce a constructor for te


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs 9acb9eefa4 286/472: Introduce a constructor for terrified ghosts (#153)
Date: Thu, 6 Jan 2022 21:59:32 -0500 (EST)

branch: elpa/pacmacs
commit 9acb9eefa4dff0fa189807c61c1d05ebd0ddfa9f
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    Introduce a constructor for terrified ghosts (#153)
---
 pacmacs.el | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/pacmacs.el b/pacmacs.el
index 4b76326ac3..5e08fd525c 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -159,6 +159,24 @@
       (let* ((animation (plist-get direction-animations direction)))
         (plist-put game-object :current-animation animation)))))
 
+(defun pacmacs--switch-direction-callback (game-object direction)
+  (plist-put game-object :direction direction))
+
+(defun pacmacs--make-terrified-ghost (row column)
+  (list :row row
+        :column column
+        :init-row row
+        :init-column column
+        :prev-row row
+        :prev-column column
+        :direction 'right
+        :current-animation (pacmacs-load-anim "Terrified-Ghost")
+        :switch-direction-callback #'pacmacs--switch-direction-callback
+        :speed 1
+        :speed-counter 0
+        :type 'terrified-ghost
+        :terrified-counter 5000))
+
 (defun pacmacs--make-ghost (row column)
   (list :row row
         :column column



reply via email to

[Prev in Thread] Current Thread [Next in Thread]