aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGene Pasquet <gene@pacerevenue.com>2025-05-14 23:18:26 +0200
committerGene Pasquet <gene@pacerevenue.com>2025-05-14 23:18:26 +0200
commit4c61d5ed377d61d072c3194d58e377569711c8b2 (patch)
tree7ad14a71e36c85be670151f3655f6787ae324fd2
parentd94d74769db51bade1f1b262285ea0b29226d97f (diff)
Tweaks
-rw-r--r--src/macroknight/game.hy15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/macroknight/game.hy b/src/macroknight/game.hy
index 42fa5ca..7227f76 100644
--- a/src/macroknight/game.hy
+++ b/src/macroknight/game.hy
@@ -164,17 +164,20 @@
(if macro-input-mode
;; If the commands list is full
- (if (all macro-commands)
+ (if (get macro-commands -1)
;; Process commands
(do
- (for [command macro-commands]
+ (pprint (lfor command macro-commands :if command command))
+ (let [#(command-id command) (get (lfor command (enumerate macro-commands) :if (get command 1) command) 0)]
(case command
pygame.K_a (.move player #((neg TILE_SIZE) 0))
pygame.K_s (.move player #(0 1))
- pygame.K_w (.move player #(0 (neg TILE_SIZE)))
- pygame.K_d (.move player #(TILE_SIZE 0))))
- (setv macro-commands [None None None])
- (setv macro-input-mode False))
+ pygame.K_w (.move player #(0 (neg player.MAX_JUMPING)))
+ pygame.K_d (.move player #(TILE_SIZE 0)))
+ (if (= command-id (- (len macro-commands) 1))
+ (do (setv macro-commands [None None None])
+ (setv macro-input-mode False))
+ (setv (get macro-commands command-id) None))))
(do (draw-tile screen 774 3 1)
(for [#(num command) (enumerate macro-commands)]