~octaspire/crates2

ref: 92e6d6bbc6044045f47bb3c8ace5c7ba461c7691 crates2/src/levels.lisp -rw-r--r-- 12.0 KiB
92e6d6bboctaspire Fix test runner by changing directory before peeking 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
;; Octaspire Crates 2 - Puzzle Game
;; Copyright 2020, 2021 octaspire.com
;;
;; Licensed under the Apache License, Version 2.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; http://www.apache.org/licenses/LICENSE-2.0
;;
;; Unless required by applicable law or agreed to in writing, software
;; distributed under the License is distributed on an "AS IS" BASIS,
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;; See the License for the specific language governing permissions and
;; limitations under the License.
(in-package :crates2)

(defparameter *num-levels* 19)

(defun load-level (index)
  (ecase index
    (0 (list (list nil nil nil :east nil nil nil :east)
             (list (make-instance 'exit        :x 6 :y 3 :z 0)
                   (make-instance 'turnstile-e :x 3 :y 3 :z 0)
                   (make-instance 'player      :x 1 :y 3 :z 0))))
    (1 (list (list nil nil nil :west nil nil nil :west)
             (list (make-instance 'exit        :x 1 :y 3 :z 0)
                   (make-instance 'turnstile-w :x 3 :y 3 :z 0)
                   (make-instance 'player      :x 6 :y 3 :z 0))))
    (2  (list (list nil nil nil :north nil nil nil :north)
              (list (make-instance 'exit        :x 3 :y 1 :z 0)
                    (make-instance 'turnstile-n :x 3 :y 3 :z 0)
                    (make-instance 'player      :x 3 :y 6 :z 0))))
    (3  (list (list nil nil nil :south nil nil nil :south)
              (list (make-instance 'exit        :x 3 :y 6 :z 0)
                    (make-instance 'turnstile-s :x 3 :y 3 :z 0)
                    (make-instance 'player      :x 3 :y 1 :z 0))))
    (4 (list (list nil nil nil :east nil nil nil :east)
             (list (make-instance 'exit         :x 6 :y 3 :z 0)
                   (make-instance 'turnstile-e1 :x 3 :y 3 :z 0)
                   (make-instance 'player       :x 1 :y 3 :z 0))))
    (5 (list (list nil nil nil :west nil nil nil :west)
             (list (make-instance 'exit         :x 1 :y 3 :z 0)
                   (make-instance 'turnstile-w1 :x 3 :y 3 :z 0)
                   (make-instance 'player       :x 6 :y 3 :z 0))))
    (6  (list (list nil nil nil :north nil nil nil :north)
              (list (make-instance 'exit         :x 3 :y 1 :z 0)
                    (make-instance 'turnstile-n1 :x 3 :y 3 :z 0)
                    (make-instance 'player       :x 3 :y 6 :z 0))))
    (7  (list (list nil nil nil :south nil nil nil :south)
              (list (make-instance 'exit         :x 3 :y 6 :z 0)
                    (make-instance 'turnstile-s1 :x 3 :y 3 :z 0)
                    (make-instance 'player       :x 3 :y 1 :z 0))))
    (8 (list (list :west nil nil nil nil nil nil nil )
             (list (make-instance 'exit     :x 10 :y 6  :z 0)
                   (make-instance 'slope-en :x 3  :y 6  :z 0)
                   (make-instance 'slope-es :x 3  :y 2  :z 0)
                   (make-instance 'slope-ws :x 14 :y 2  :z 0)
                   (make-instance 'slope-wn :x 14 :y 6  :z 0)
                   (make-instance 'player   :x 8  :y 6 :z 0))))
    (9 (list (list :west nil nil nil nil nil nil nil nil nil nil nil)
             (list (make-instance 'exit :x 1 :y 2 :z 0)
                   ;; (make-instance 'vacuum :x 3 :y 2 :z -1)
                   (make-instance 'player :x 5 :y 2 :z 0))))
    (10 (list (list nil nil nil nil :west nil nil nil nil :west nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil :west)
              (list (make-instance 'exit        :x 1 :y 3 :z 0)
                    ;; (make-instance 'block-timer :x 4 :y 3 :z 0)
                    (make-instance 'player      :x 8 :y 3 :z 0))))
    (11 (list (list nil nil nil nil :west nil nil nil :east nil nil nil :west nil nil nil :east nil nil nil :west)
              (list (make-instance 'exit          :x 1 :y 3 :z 0)
                    (make-instance 'block-counter :x 3 :y 3 :z 0 :count 2)
                    (make-instance 'player        :x 5 :y 3 :z 0)
                    (make-instance 'block-counter :x 8 :y 3 :z 0))))
    (12 (list (list nil nil nil nil :west nil nil nil nil nil :east nil nil nil nil nil :west nil nil nil nil nil nil nil :east nil nil nil nil :south)
              (list (make-instance 'wall         :x 1 :y 3 :z 0)
                    (make-instance 'exit         :x 3 :y 5 :z 0)
                    (make-instance 'pass-counter :x 4 :y 3 :z 1 :count 3)
                    (make-instance 'player       :x 5 :y 3 :z 0)
                    (make-instance 'wall         :x 8 :y 3 :z 0))))
    (13 (list (list nil nil nil nil :west)
              (list (make-instance 'wall         :x 1 :y 3 :z 0)
                    (make-instance 'exit         :x 5 :y 5 :z 0)
                    ;; (make-instance 'pass-timer   :x 4 :y 3 :z 1 :time 10)
                    (make-instance 'player       :x 6 :y 5 :z 0)
                    (make-instance 'wall         :x 8 :y 3 :z 0))))
    (14 (list (list nil nil nil nil :west nil nil nil nil nil nil nil nil :south)
              (list (make-instance 'wall         :x 1 :y 3 :z 0)
                    (make-instance 'exit         :x 6 :y 5 :z 0)
                    (make-instance 'exit         :x 2 :y 5 :z 0)
                    (make-instance 'key          :x 4 :y 3 :z 0)
                    (make-instance 'player       :x 6 :y 3 :z 0))))
    (15 (list (list nil nil nil nil :west nil nil nil nil nil nil nil nil :south nil nil nil nil nil :north nil nil nil nil nil :east nil nil nil nil nil nil :south)
              (list (make-instance 'wall         :x 1 :y 3 :z 0)
                    (make-instance 'wall         :x 2 :y 0 :z 0)
                    (make-instance 'wall         :x 7 :y 1 :z 0)
                    (make-instance 'exit         :x 6 :y 5 :z 0)
                    (make-instance 'player       :x 6 :y 3 :z 0)
                    (make-instance 'pulled       :x 2 :y 5 :z 0 :north t))))
    (16 (list (list nil nil nil nil
                    :east  nil nil nil nil nil nil nil nil
                    :west  nil nil nil nil nil
                    :north nil nil nil nil nil
                    :south nil nil nil nil nil nil nil nil nil nil nil nil
                    :west  nil nil nil nil nil nil nil nil
                    :east  nil nil nil nil nil nil nil
                    :south nil nil nil nil
                    :north)
              (list (make-instance 'pulled       :x 4 :y 3 :z 0 :east t)
                    (make-instance 'pulled       :x 5 :y 9 :z 0 :north t)
                    (make-instance 'player       :x 6 :y 3 :z 0)
                    (make-instance 'pulled       :x 8 :y 3 :z 0 :west t)
                    (make-instance 'pulled       :x 5 :y 2 :z 0 :south t)
                    (make-instance 'pulled       :x 2 :y 8 :z 0 :east t)
                    (make-instance 'pulled       :x 9 :y 8 :z 0 :west t)
                    (make-instance 'pulled       :x 8 :y 9 :z 0 :north t)
                    (make-instance 'exit         :x 8 :y 2 :z 0))))
    (17 (list (list nil nil
                    :north nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
                    nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
                    nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil
                    :west nil nil nil nil nil nil nil nil nil nil nil
                    :south nil nil nil nil nil nil
                    :north nil nil nil nil nil nil
                    :east nil nil nil nil nil nil nil nil nil nil
                    :south nil nil nil
                    :west nil nil nil nil nil
                    :south nil nil nil nil
                    :west nil nil nil nil
                    :north nil nil nil
                    :west nil nil nil
                    :north nil nil nil
                    :west)
              (list (make-instance 'slope-es     :x 6  :y 0 :z 0)
                    (make-instance 'slope-ws     :x 11 :y 0 :z 0)
                    (make-instance 'block-timer  :x 2  :y 2 :z 0 :time 18)
                    (make-instance 'exit         :x 0  :y 3 :z 0 )
                    (make-instance 'turnstile-s  :x 3  :y 3 :z 0 )
                    (make-instance 'player       :x 6  :y 3 :z 0 )
                    (make-instance 'pass-counter :x 11 :y 3 :z 1 :count 2)
                    (make-instance 'wall         :x 9  :y 4 :z 0)
                    (make-instance 'wall         :x 4  :y 5 :z 0)
                    (make-instance 'wall         :x 1  :y 6 :z 0)
                    (make-instance 'wall         :x 8  :y 6 :z 0)
                    (make-instance 'key          :x 3  :y 7 :z 0)
                    (make-instance 'wall         :x 3  :y 8 :z 0)
                    (make-instance 'slope-en     :x 6  :y 8 :z 0)
                    (make-instance 'slope-wn     :x 11 :y 8 :z 0)
                    (make-instance 'wall         :x 5  :y 9 :z 0))))
    (18 (list (list nil nil
                    :west nil nil nil nil nil nil
                    :south nil nil nil nil
                    :east nil nil nil nil
                    :north nil nil nil
                    :south nil nil nil
                    :east nil nil nil nil nil
                    :north nil nil nil
                    :west nil nil
                    :east nil nil nil nil
                    :north nil nil nil nil nil
                    :west nil nil nil nil
                    :south nil nil nil
                    :north nil nil nil nil
                    :west nil nil nil nil nil nil
                    :south nil nil nil
                    :east nil nil
                    :west nil nil nil nil
                    :south)
              (list (make-instance 'wall          :x 5  :y 0 :z 0)
                    (make-instance 'block-counter :x 7  :y 0 :count 1)
                    (make-instance 'block-counter :x 1  :y 1 :count 1)
                    (make-instance 'block-counter :x 9  :y 1 :count 1)
                    (make-instance 'wall          :x 4  :y 2)
                    (make-instance 'wall          :x 6  :y 2)
                    (make-instance 'block-counter :x 0  :y 3 :count 1)
                    (make-instance 'key           :x 3  :y 3)
                    (make-instance 'wall          :x 4  :y 3)
                    (make-instance 'wall          :x 6  :y 3)
                    (make-instance 'key           :x 7  :y 3)
                    (make-instance 'wall          :x 2  :y 4)
                    (make-instance 'wall          :x 3  :y 4)
                    (make-instance 'wall          :x 4  :y 4)
                    (make-instance 'wall          :x 6  :y 4)
                    (make-instance 'wall          :x 7  :y 4)
                    (make-instance 'wall          :x 8  :y 4)
                    (make-instance 'wall          :x 0  :y 5)
                    (make-instance 'player        :x 5  :y 5)
                    (make-instance 'wall          :x 10 :y 5)
                    (make-instance 'wall          :x 2  :y 6)
                    (make-instance 'wall          :x 3  :y 6)
                    (make-instance 'wall          :x 4  :y 6)
                    (make-instance 'wall          :x 6  :y 6)
                    (make-instance 'wall          :x 7  :y 6)
                    (make-instance 'wall          :x 8  :y 6)
                    (make-instance 'key           :x 3  :y 7)
                    (make-instance 'wall          :x 4  :y 7)
                    (make-instance 'wall          :x 6  :y 7)
                    (make-instance 'key           :x 7  :y 7)
                    (make-instance 'block-counter :x 10 :y 7 :count 1)
                    (make-instance 'wall          :x 4  :y 8)
                    (make-instance 'wall          :x 6  :y 8)
                    (make-instance 'block-counter :x 1  :y 9 :count 1)
                    (make-instance 'block-counter :x 9  :y 9 :count 1)
                    (make-instance 'exit          :x 1  :y 10)
                    (make-instance 'block-counter :x 3  :y 10 :count 1)
                    (make-instance 'wall          :x 5  :y 10))))))