branch: elpa/pacmacs
commit 9acb9eefa4dff0fa189807c61c1d05ebd0ddfa9f
Author: rexim <[email protected]>
Commit: rexim <[email protected]>
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