[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs be91d566cb 139/472: Implement Game Over state. Clo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs be91d566cb 139/472: Implement Game Over state. Close #94 |
Date: |
Thu, 6 Jan 2022 21:59:19 -0500 (EST) |
branch: elpa/pacmacs
commit be91d566cbaef266f84a92489f05a3f3c059f397
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Implement Game Over state. Close #94
---
maps/game-over.txt | 13 +++++++++++++
pacmacs.el | 23 ++++++++++++++++-------
2 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/maps/game-over.txt b/maps/game-over.txt
new file mode 100644
index 0000000000..7d005bd7d1
--- /dev/null
+++ b/maps/game-over.txt
@@ -0,0 +1,13 @@
+####
+# # ### ##### ##
+# # # # # # #
+# ## ### # # # ##
+# # # # # # # #
+#### # # # # # ##
+
+####
+# # # # ## ###
+# # # # # # #
+# # # ## ## ####
+# # # # # # #
+#### ### ## # #
diff --git a/pacmacs.el b/pacmacs.el
index 3b40f3e844..0bf81b8ce2 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -83,11 +83,12 @@
(define-key pacmacs-mode-map (kbd "<right>") 'pacmacs-right)
(define-key pacmacs-mode-map (kbd "q") 'pacmacs-quit)
(add-hook 'kill-buffer-hook 'pacmacs-destroy nil t)
- (setq cursor-type nil))
+ (setq cursor-type nil)
+ (setq truncate-lines t))
(defun pacmacs-start ()
(interactive)
- (switch-to-buffer-other-window pacmacs-buffer-name)
+ (switch-to-buffer pacmacs-buffer-name)
(pacmacs-mode)
(setq pacmacs-lives 3)
@@ -354,7 +355,9 @@
(plist-get pacmacs-player-state
:current-animation)
:current-frame))
- (pacmacs--switch-to-play-state)))
+ (if (<= pacmacs-lives 0)
+ (pacmacs--switch-to-game-over-state)
+ (pacmacs--switch-to-play-state))))
(defun pacmacs-waiting-logic (switcher)
(if (<= pacmacs-waiting-counter 0)
@@ -372,10 +375,11 @@
(pacmacs-render-anim anim)))
(defun pacmacs--put-object (anim-object)
- (plist-bind ((row :row)
- (column :column))
- anim-object
- (pacmacs--cell-set pacmacs-board row column anim-object)))
+ (when anim-object
+ (plist-bind ((row :row)
+ (column :column))
+ anim-object
+ (pacmacs--cell-set pacmacs-board row column anim-object))))
(defun pacmacs--switch-to-death-state ()
(setq pacmacs-game-state 'death)
@@ -383,6 +387,10 @@
(plist-put pacmacs-player-state :current-animation
(pacmacs-load-anim "Pacman-Death")))
+(defun pacmacs--switch-to-game-over-state ()
+ (setq pacmacs-game-state 'game-over)
+ (pacmacs-load-map "game-over"))
+
(defun pacmacs--switch-to-play-state ()
(setq pacmacs-game-state 'play)
(pacmacs--reset-object-position pacmacs-player-state)
@@ -489,6 +497,7 @@
(setq pacmacs-wall-cells nil)
(setq pacmacs-pills nil)
(setq pacmacs-ghosts nil)
+ (setq pacmacs-player-state nil)
(loop
for line being the element of lines using (index row)
- [nongnu] elpa/pacmacs 1e29c2f943 101/472: UTs for pacmacs--cell-tracked-p (#75), (continued)
- [nongnu] elpa/pacmacs 1e29c2f943 101/472: UTs for pacmacs--cell-tracked-p (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0839611f42 108/472: Refactor out pacmacs--make-board function (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8aa9d50dda 102/472: Remove pacmacs--within-of-map-p (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7714743aa8 103/472: UTs for pacmacs--track-point (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2c0bcf993f 107/472: Use two-argumented `<=`. Close #76, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e5bd77740d 119/472: Fix NPEs (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 286eb99ae0 130/472: Implement prepare phase. Close #80, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d14cdd38e3 135/472: Fix last eaten pill visibility. Close #96, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9cb186f10a 137/472: Refactor pacmacs-inversed-direction-table out. Close #103, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91c317819c 123/472: Implement basic death mechanics (#69), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs be91d566cb 139/472: Implement Game Over state. Close #94,
ELPA Syncer <=
- [nongnu] elpa/pacmacs b8cd22229d 142/472: Introduce pacmacs--anim-object-list-next-frame, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91e432111b 145/472: Implement basic score table mechnism (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7058b61e47 146/472: Implement adding entries to score table (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e032089ab4 151/472: Render score table on Game Over screen (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a7b0530f65 152/472: Merge branch 'score-table-92'. Close #92, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1b2ca64cd1 157/472: Merge branch 'resource-packaging-95'. Close #95, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 48ecc5cee9 159/472: Don't fail if the score file doesn't exist, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 10b8a997dd 037/472: More precise instructions in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7e04991d4e 030/472: Add UT for pacman-compare-aseprite-frames function (#22), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 327332d32d 036/472: Update README, ELPA Syncer, 2022/01/06