[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 4341b23d87 094/472: Implement wraparound. Close #6
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 4341b23d87 094/472: Implement wraparound. Close #67 |
Date: |
Thu, 6 Jan 2022 21:59:15 -0500 (EST) |
branch: elpa/pacmacs
commit 4341b23d87bed0efc27071e437057854c97e842c
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Implement wraparound. Close #67
---
maps/map02.txt | 12 ++++++++++++
pacmacs.el | 11 ++++++-----
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/maps/map02.txt b/maps/map02.txt
new file mode 100644
index 0000000000..dd7db15c48
--- /dev/null
+++ b/maps/map02.txt
@@ -0,0 +1,12 @@
+#### ####
+# #
+# ## ## #
+# #
+# ## ## #
+# #
+# ## ## #
+ o
+# ## ## #
+# #
+#g #
+#### ####
diff --git a/pacmacs.el b/pacmacs.el
index 90ec5badb1..ad805c2575 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -89,7 +89,7 @@
(interactive)
(switch-to-buffer-other-window pacmacs-buffer-name)
(pacmacs-mode)
- (pacmacs-load-map "map01")
+ (pacmacs-load-map "map02")
(unless pacmacs-timer
(setq pacmacs-timer (run-at-time nil (* pacmacs-tick-duration-ms 0.001)
'pacmacs-tick))))
@@ -197,11 +197,12 @@
game-object
(if (zerop speed-counter)
(let* ((velocity (plist-get pacmacs-direction-table direction))
- (new-row (+ row (cdr velocity)))
- (new-column (+ column (car velocity))))
+ (new-row (mod (+ row (cdr velocity))
+ pacmacs-board-height))
+ (new-column (mod (+ column (car velocity))
+ pacmacs-board-width)))
(plist-put game-object :speed-counter speed)
- (when (and (pacmacs--within-of-map-p new-row new-column)
- (not (pacmacs--wall-at-p new-row new-column)))
+ (when (not (pacmacs--wall-at-p new-row new-column))
(plist-put game-object :row new-row)
(plist-put game-object :column new-column)))
(plist-put game-object :speed-counter (1- speed-counter)))))
- [nongnu] elpa/pacmacs 864fe2b02e 465/472: Bump the copyright year for all the files, (continued)
- [nongnu] elpa/pacmacs 864fe2b02e 465/472: Bump the copyright year for all the files, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs edadbe5e53 469/472: Bump version to 0.1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs db16fba9cd 470/472: Add missing license statement, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 98ce700143 023/472: Hide cursor in the game's buffer. Close #12, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 3070cf0e6a 063/472: Merge branch 'refactor-image-resource-51'. Close #51, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1a678dfee7 110/472: Refactor out pacmacs--object-at-p (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5492ed0a87 118/472: Refactor pacmacs-render-state (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b5078d2632 141/472: Move most of the rendering stuff to pacman-render, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a460cd8b06 148/472: Merge pull request #107 from rexim/feature/new-maps, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c426f6ac91 078/472: Fix some accidental paredit typo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4341b23d87 094/472: Implement wraparound. Close #67,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 12942ddeff 113/472: Refactor out pacmacs--fill-board (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91408c074d 115/472: Refactor pacmacs--track-object (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ed40addf95 116/472: Refactor pacmacs--put-object (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs eac9d47c62 117/472: Refactor pacmacs-render-track-board (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d763bd0f82 121/472: Fix the UTs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9527a965e1 134/472: Merge branch 'switch-game-state-in-logic-functions-97'. Close #97, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 86f76c4bef 129/472: Implement switching level mechanics. Close #79, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fa41daf2ca 149/472: Merge branch 'master' into score-table-92, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 85069784fb 147/472: Add a couple of new maps., ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 39fc09baf3 161/472: Load cl-lib.el for using its macros and functions, ELPA Syncer, 2022/01/06