[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 0546e964b1 222/472: Connected walls proof of conce
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 0546e964b1 222/472: Connected walls proof of concept for #131 |
Date: |
Thu, 6 Jan 2022 21:59:26 -0500 (EST) |
branch: elpa/pacmacs
commit 0546e964b10e82542f432624424a8dded36efd04
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Connected walls proof of concept for #131
---
pacmacs-image.el | 39 +++++++++++++++++++++++++++++++++++++++
pacmacs.el | 19 ++++++++++++++-----
2 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/pacmacs-image.el b/pacmacs-image.el
index 25c30034a3..cfcb568712 100644
--- a/pacmacs-image.el
+++ b/pacmacs-image.el
@@ -46,6 +46,45 @@
:foreground color
:background color))
+(defun pacmacs--create-wall-block (width height color bottom right top left)
+ (let ((wall-block (make-vector
+ width nil)))
+
+ (dotimes (i width)
+ (aset wall-block i (make-bool-vector height nil)))
+
+ (when left
+ (dotimes (i height)
+ (aset (aref wall-block i) 0 t)
+ (aset (aref wall-block i) 1 t)
+ (aset (aref wall-block i) 2 t)
+ ))
+
+ (when right
+ (dotimes (i height)
+ (aset (aref wall-block i) (1- width) t)
+ (aset (aref wall-block i) (- width 2) t)
+ (aset (aref wall-block i) (- width 3) t)
+ ))
+
+ (when top
+ (dotimes (i width)
+ (aset (aref wall-block 0) i t)
+ (aset (aref wall-block 1) i t)
+ (aset (aref wall-block 2) i t)
+ ))
+
+ (when bottom
+ (dotimes (i width)
+ (aset (aref wall-block (1- height)) i t)
+ (aset (aref wall-block (- height 2)) i t)
+ (aset (aref wall-block (- height 3)) i t)
+ ))
+
+ (create-image wall-block 'xbm t :width width :height height
+ :foreground color
+ :background nil)))
+
(defun pacmacs-create-transparent-block (width height)
(create-image
(make-vector
diff --git a/pacmacs.el b/pacmacs.el
index 9d6b3f4cb4..f7d90f386b 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -244,10 +244,10 @@
(plist-put game-object :speed-counter (1- speed-counter)))))
(defun pacmacs--possible-ways (row column)
- (list (cons (1+ row) column)
- (cons row (1+ column))
- (cons (1- row) column)
- (cons row (1- column))))
+ (list (cons (1+ row) column) ;down
+ (cons row (1+ column)) ;right
+ (cons (1- row) column) ;up
+ (cons row (1- column)))) ;left
(defun pacmacs--filter-candidates (p)
(let ((row (car p))
@@ -456,7 +456,16 @@
(dotimes (column width)
(let ((anim-object (car (pacmacs--cell-wrapped-get
pacmacs--object-board
row column))))
- (pacmacs--render-object anim-object)))
+ (plist-bind ((type :type))
+ anim-object
+ (if (not (equal type 'wall))
+ (pacmacs--render-object anim-object)
+ (pacmacs-insert-image (apply #'pacmacs--create-wall-block
+ 40 40 "blue"
+ (-map (-lambda ((row . column))
+ (not
(pacmacs--wall-at-p row column)))
+ (pacmacs--possible-ways
row column)))
+ '(0 0 40 40))))))
(insert "\n")))
(insert "\n")
(dotimes (i pacmacs-lives)
- [nongnu] elpa/pacmacs ce1054fab3 433/472: Remove redundant find-resource-file call (#191), (continued)
- [nongnu] elpa/pacmacs ce1054fab3 433/472: Remove redundant find-resource-file call (#191), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 21a99294ad 440/472: Add score sign (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9fd3009e5a 442/472: Merge pull request #206 from codingteam/bug/quit-game-over-with-q-202, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 95cce606fd 024/472: Support for Aseprite animation format. Close #16, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 09aa49c6b0 065/472: UTs for pacman-image. Close #52, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ee893d28bd 180/472: Add module for recording action (#115), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 95c046205a 187/472: Compilation warnings as errors (#123), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fe40eb20c7 190/472: Merge branch 'coverage-dropped-124' (#124), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8e36b66a6f 199/472: Make object-board contain list of object (#126), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 6b43cde65d 223/472: Add big pill game object (#81), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0546e964b1 222/472: Connected walls proof of concept for #131,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 19ffa64f7e 230/472: Merge branch 'master' into connecte-walls, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e0856fc881 244/472: Refactor wall tiles functions (#131):, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 79aa80e1d2 245/472: Merge branch 'connecte-walls'. Close #131, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2b9811e71b 246/472: Add README for tools, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8e00815b4f 253/472: Disable undo for Pacmacs buffer. Close #143, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8a79a510ea 257/472: Blinking big pill (#81), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 93d8b91792 266/472: Merge branch 'automate-sprite-generting-26'., ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e618da968d 279/472: Add UT for pacmacs--sort-score-table, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9ec0ff9f4d 280/472: Add UT for pacmacs--render-score-table, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 612d7ff1dd 297/472: UT for pacmacs--decrease-terrified-timers (#153), ELPA Syncer, 2022/01/06