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))
|
(let lp ((i 0) (player #f))
|
||||||
(if (< i len)
|
(if (< i len)
|
||||||
(let* ((x (bytevector-u8-ref objects i))
|
(let* ((x (bytevector-u8-ref objects i))
|
||||||
(y (bytevector-u8-ref objects (+ i 1)))
|
(y (bytevector-u8-ref objects (+ i 1)))
|
||||||
(id (bytevector-u8-ref objects (+ i 2)))
|
(id (bytevector-u8-ref objects (+ i 2)))
|
||||||
(obj (match id
|
(obj (match id
|
||||||
(1 (spawn ^wall x y 'brick))
|
(1 (spawn ^wall x y 'brick))
|
||||||
(2 (spawn ^wall x y 'copper))
|
(2 (spawn ^wall x y 'copper))
|
||||||
(3 (spawn ^player x y))
|
(3 (spawn ^player x y))
|
||||||
(4 (spawn ^exit x y))
|
(4 (spawn ^exit x y))
|
||||||
(5 (spawn ^block x y 'copper))
|
(5 (spawn ^block x y 'copper))
|
||||||
(6 (spawn ^block x y 'crate))
|
(6 (spawn ^block x y 'crate))
|
||||||
(7 (spawn ^clock-emitter x y 4))
|
(7 (spawn ^clock-emitter x y 4))
|
||||||
(8 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
(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)))
|
|
||||||
(target-y (bytevector-u8-ref objects (+ i 4))))
|
(target-y (bytevector-u8-ref objects (+ i 4))))
|
||||||
(spawn ^electric-switch x y target-x target-y)))
|
(spawn ^floor-switch x y target-x target-y)))
|
||||||
(id (error "invalid level object" id))))
|
(9 (and spawn-gem? (spawn ^gem x y)))
|
||||||
(i* (+ i (match id
|
(10 (spawn ^gate x y))
|
||||||
;; floor-switch or electric-switch
|
(11 (spawn ^and-gate x y))
|
||||||
((or 8 12) 5)
|
(12 (let ((target-x (bytevector-u8-ref objects (+ i 3)))
|
||||||
(_ 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
|
(when obj
|
||||||
($ level* 'add-object obj))
|
($ level* 'add-object obj))
|
||||||
(if (= id 3) ; player-spawn
|
(if (= id 3) ; player-spawn
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="21">
|
<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="22">
|
||||||
<tileset firstgid="1" source="tiles.tsx"/>
|
<tileset firstgid="1" source="tiles.tsx"/>
|
||||||
<layer id="1" name="background" width="20" height="15">
|
<layer id="1" name="background" width="20" height="15" visible="0">
|
||||||
<data encoding="csv">
|
<data encoding="csv">
|
||||||
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
|
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
|
||||||
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
|
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="12">
|
<map version="1.8" tiledversion="1.8.6" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="13">
|
||||||
<tileset firstgid="1" source="tiles.tsx"/>
|
<tileset firstgid="1" source="tiles.tsx"/>
|
||||||
<layer id="1" name="background" width="20" height="15">
|
<layer id="1" name="background" width="20" height="15">
|
||||||
<data encoding="csv">
|
<data encoding="csv">
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
</data>
|
</data>
|
||||||
</layer>
|
</layer>
|
||||||
<objectgroup id="2" name="objects">
|
<objectgroup id="2" name="objects">
|
||||||
<object id="1" type="player-spawn" gid="1" x="80" y="144" width="16" height="16"/>
|
<object id="1" type="player-spawn" gid="1" x="80" y="128" width="16" height="16"/>
|
||||||
<object id="4" type="block" gid="4" x="80" y="128" width="16" height="16">
|
<object id="4" type="block" gid="4" x="80" y="112" width="16" height="16">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="kind" value="copper"/>
|
<property name="kind" value="copper"/>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
Loading…
Add table
Reference in a new issue