Skip to content

Commit

Permalink
level 10; fix moving order
Browse files Browse the repository at this point in the history
  • Loading branch information
dawranliou committed Nov 6, 2022
1 parent cf84807 commit fa27b4e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions data/level-10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
....a.t.
........
t...g...
........
........
G..a...c
C..t...a
8 changes: 6 additions & 2 deletions mode-play.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@
found)

(fn run-input-system [key]
(match key
"up" (table.sort *entities* #(< $1.row $2.row))
"down" (table.sort *entities* #(< $2.row $1.row))
"left" (table.sort *entities* #(< $1.col $2.col))
"right" (table.sort *entities* #(< $2.col $1.col)))
(each [_ e (ipairs *entities*)]
(when e.components.input
(let [target-entity (match key
Expand Down Expand Up @@ -197,8 +202,7 @@
"data/level-6.txt" "data/level-7.txt"
"data/level-7.txt" "data/level-8.txt"
"data/level-8.txt" "data/level-9.txt"
;; "data/level-9.txt" "data/level-10.txt"
)]
"data/level-9.txt" "data/level-10.txt")]
(if next-level
(load-level next-level)
(set *state* :win))))
Expand Down

0 comments on commit fa27b4e

Please sign in to comment.