Reindent some stuff.
This commit is contained in:
parent
582eb6309d
commit
dc05a9cd05
3 changed files with 28 additions and 28 deletions
|
@ -27,30 +27,30 @@
|
|||
(let lp ((i 0) (player #f))
|
||||
(if (< i len)
|
||||
(let* ((x (bytevector-u8-ref objects i))
|
||||
(y (bytevector-u8-ref objects (+ i 1)))
|
||||
(id (bytevector-u8-ref objects (+ i 2)))
|
||||
(obj (match id
|
||||
(1 (spawn ^wall x y 'brick))
|
||||
(2 (spawn ^wall x y 'copper))
|
||||
(3 (spawn ^player x y))
|
||||
(4 (spawn ^exit x y))
|
||||
(5 (spawn ^block x y 'copper))
|
||||
(6 (spawn ^block x y 'crate))
|
||||
(7 (spawn ^clock-emitter x y 4))
|
||||
(8 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
||||
(target-y (bytevector-u8-ref objects (+ i 4))))
|
||||
(spawn ^floor-switch x y target-x target-y)))
|
||||
(9 (and spawn-gem? (spawn ^gem x y)))
|
||||
(10 (spawn ^gate x y))
|
||||
(11 (spawn ^and-gate x y))
|
||||
(12 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
||||
(y (bytevector-u8-ref objects (+ i 1)))
|
||||
(id (bytevector-u8-ref objects (+ i 2)))
|
||||
(obj (match id
|
||||
(1 (spawn ^wall x y 'brick))
|
||||
(2 (spawn ^wall x y 'copper))
|
||||
(3 (spawn ^player x y))
|
||||
(4 (spawn ^exit x y))
|
||||
(5 (spawn ^block x y 'copper))
|
||||
(6 (spawn ^block x y 'crate))
|
||||
(7 (spawn ^clock-emitter x y 4))
|
||||
(8 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
||||
(target-y (bytevector-u8-ref objects (+ i 4))))
|
||||
(spawn ^electric-switch x y target-x target-y)))
|
||||
(id (error "invalid level object" id))))
|
||||
(i* (+ i (match id
|
||||
;; floor-switch or electric-switch
|
||||
((or 8 12) 5)
|
||||
(_ 3)))))
|
||||
(spawn ^floor-switch x y target-x target-y)))
|
||||
(9 (and spawn-gem? (spawn ^gem x y)))
|
||||
(10 (spawn ^gate x y))
|
||||
(11 (spawn ^and-gate x y))
|
||||
(12 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
||||
(target-y (bytevector-u8-ref objects (+ i 4))))
|
||||
(spawn ^electric-switch x y target-x target-y)))
|
||||
(id (error "invalid level object" id))))
|
||||
(i* (+ i (match id
|
||||
;; floor-switch or electric-switch
|
||||
((or 8 12) 5)
|
||||
(_ 3)))))
|
||||
(when obj
|
||||
($ level* 'add-object obj))
|
||||
(if (= id 3) ; player-spawn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue