Add level progression.

This commit is contained in:
David Thompson 2024-05-20 13:34:59 -04:00
parent 99d7643c47
commit ce0c002e8b
8 changed files with 211 additions and 41 deletions

View file

@ -27,13 +27,16 @@
(y (bytevector-u8-ref objects (+ i 1)))
(id (bytevector-u8-ref objects (+ i 2))))
(if (= id 3) ; player-spawn
($ level* 'warp-player x y)
(begin
(pk 'spawn-player x y)
($ level* 'warp-player x y))
(let ((obj (match id
(1 (spawn ^wall 'brick))
(2 (spawn ^wall 'copper))
(4 (spawn ^exit))
(5 (spawn ^block 'copper))
(6 (spawn ^clock-emitter 4))
(6 (spawn ^block 'crate))
(7 (spawn ^clock-emitter 4))
(id (error "invalid level object" id)))))
($ level* 'set-object x y obj))))
(lp (+ i 3)))))

View file

@ -1,31 +1,26 @@
<?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="5">
<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="6">
<tileset firstgid="1" source="tiles.tsx"/>
<layer id="1" name="background" width="20" height="15">
<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,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,23,
23,23,24,24,24,24,24,24,24,28,24,24,24,24,24,24,24,24,23,23,
23,24,24,24,24,24,24,24,24,24,24,24,3,3,24,24,24,24,24,23,
23,49,3,3,3,3,24,3,3,3,3,3,3,24,3,3,3,3,3,23,
23,24,24,24,24,24,24,24,24,24,24,24,3,3,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,
23,23,24,24,24,24,24,24,24,24,24,24,28,24,24,24,24,24,23,23,
23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,
23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,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,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23
</data>
</layer>
<objectgroup id="2" name="objects">
<object id="1" type="player-spawn" gid="1" x="128" y="144" width="16" height="16"/>
<object id="4" type="block" gid="4" x="96" y="80" width="16" height="16">
<properties>
<property name="kind" value="copper"/>
</properties>
</object>
<object id="1" type="player-spawn" gid="1" x="96" y="112" width="16" height="16"/>
</objectgroup>
</map>

View file

@ -0,0 +1,101 @@
<?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">
<tileset firstgid="1" source="tiles.tsx"/>
<layer id="1" name="background" width="20" height="15">
<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,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,28,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,24,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,24,24,24,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,24,24,24,24,24,24,23,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,24,24,24,24,24,24,24,24,23,23,23,23,23,23,
23,23,23,23,23,23,23,24,24,24,24,24,24,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
</data>
</layer>
<objectgroup id="2" name="objects">
<object id="1" type="player-spawn" gid="1" x="160" y="176" width="16" height="16"/>
<object id="6" type="block" gid="30" x="160" y="112" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="7" type="block" gid="30" x="208" y="32" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="8" type="block" gid="30" x="208" y="48" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="9" type="block" gid="30" x="192" y="32" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="10" type="block" gid="30" x="96" y="32" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="11" type="block" gid="30" x="112" y="32" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="12" type="block" gid="30" x="96" y="48" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="13" type="block" gid="30" x="208" y="96" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="14" type="block" gid="30" x="208" y="80" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="15" type="block" gid="30" x="192" y="96" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="16" type="block" gid="30" x="96" y="96" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="17" type="block" gid="30" x="96" y="80" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="18" type="block" gid="30" x="112" y="96" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="19" type="block" gid="30" x="128" y="160" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
<object id="20" type="block" gid="30" x="192" y="160" width="16" height="16">
<properties>
<property name="kind" value="crate"/>
</properties>
</object>
</objectgroup>
</map>

View file

@ -0,0 +1,31 @@
<?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="5">
<tileset firstgid="1" source="tiles.tsx"/>
<layer id="1" name="background" width="20" height="15">
<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,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,23,
23,23,24,24,24,24,24,24,24,28,24,24,24,24,24,24,24,24,23,23,
23,24,24,24,24,24,24,24,24,24,24,24,3,3,24,24,24,24,24,23,
23,49,3,3,3,3,24,3,3,3,3,3,3,24,3,3,3,3,3,23,
23,24,24,24,24,24,24,24,24,24,24,24,3,3,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,
23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,
23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23
</data>
</layer>
<objectgroup id="2" name="objects">
<object id="1" type="player-spawn" gid="1" x="128" y="144" width="16" height="16"/>
<object id="4" type="block" gid="4" x="96" y="80" width="16" height="16">
<properties>
<property name="kind" value="copper"/>
</properties>
</object>
</objectgroup>
</map>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.8" tiledversion="1.8.6" name="tiles" tilewidth="16" tileheight="16" tilecount="300" columns="20">
<tileset version="1.8" tiledversion="1.8.6" name="tiles" tilewidth="16" tileheight="16" tilecount="300" columns="20" objectalignment="topleft">
<image source="../../../assets/images/cirkoban.png" width="320" height="240"/>
<tile id="2" type="wall">
<properties>