start work on making a map bigger than the screen

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-07-01 20:22:38 -04:00
parent 90cffa5e6f
commit 3492329649
10 changed files with 1311 additions and 473 deletions

View File

@ -1,11 +1,11 @@
const std = @import("std");
pub fn mapgen(b: *std.build.Step) !void {
fn mapgen(b: *std.build.Step) !void {
_ = b;
var alloc = std.heap.page_allocator;
const maps = [_][2][]const u8{
[2][]const u8{"./maps/TestMap.json", "./src/maps/test.zig"},
[2][]const u8{"./maps/rpgbig.json", "./src/maps/rpgbig.zig"},
[2][]const u8{"./maps/RPGmap.json", "./src/maps/rpg.zig"},
};
@ -16,9 +16,21 @@ pub fn mapgen(b: *std.build.Step) !void {
}
}
fn release(b: *std.build.Step) !void {
_ = b;
var alloc = std.heap.page_allocator;
var rel = std.ChildProcess.init(&.{"bash", "./release.sh"}, alloc);
try rel.spawn();
_ = try rel.wait();
}
pub fn build(b: *std.build.Builder) !void {
const map_step = b.step("mapgen", "generate maps");
map_step.makeFn = mapgen;
const release_step = b.step("release", "generate release binaries");
release_step.makeFn = release;
const mode = b.standardReleaseOptions();
const lib = b.addSharedLibrary("cart", "src/main.zig", .unversioned);

View File

@ -1,326 +1,328 @@
{ "compressionlevel":-1,
"editorsettings":
{
"export":
{
"format":"json",
"target":"RPGmap.json"
}
},
"height":10,
"infinite":false,
"layers":[
{
"data":[1, 1, 1, 18, 1, 19, 20, 21, 1, 18, 69, 1, 35, 52, 1, 36, 53, 38, 35, 52, 1, 18, 1, 18, 86, 88, 104, 1, 18, 17, 35, 52, 35, 52, 105, 1, 18, 35, 92, 1, 18, 69, 1, 1, 105, 35, 52, 1, 81, 1, 52, 35, 1, 18, 105, 67, 66, 97, 98, 99, 1, 68, 35, 52, 105, 66, 67, 114, 115, 116, 18, 103, 88, 88, 106, 1, 1, 100, 118, 101, 52, 1, 1, 1, 103, 88, 88, 88, 107, 88, 11, 13, 1, 12, 1, 69, 1, 18, 35, 52],
"height":10,
"id":1,
"name":"map",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":10,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":2,
"name":"coll",
"objects":[
{
"height":16.4511859920595,
"id":1,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":47.3989616206862,
"x":80.301333604805,
"y":-0.325766059248702
},
{
"height":9.44721571821236,
"id":6,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16.2883029624351,
"x":127.863178255116,
"y":70.3654687977196
},
{
"height":15.8181818181818,
"id":16,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":11.4545454545455,
"x":146.181818181818,
"y":32
},
{
"height":12.7272727272727,
"id":17,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":11.8181818181818,
"x":18,
"y":97.8181818181818
},
{
"height":13.4545454545455,
"id":18,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":12,
"x":113.818181818182,
"y":16.3636363636364
},
{
"height":14.5454545454545,
"id":19,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":13.0909090909091,
"x":81.2727272727273,
"y":16.3636363636364
},
{
"height":26.7272727272727,
"id":20,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":26,
"x":82.9090909090909,
"y":85.2727272727273
},
{
"height":4.54545454545455,
"id":21,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":8.18181818181819,
"x":99.6363636363636,
"y":80.9090909090909
},
{
"height":17.2727272727273,
"id":22,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":47.6363636363637,
"x":112,
"y":94.1818181818182
},
{
"height":7.27272727272728,
"id":23,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":30.3636363636364,
"x":120.727272727273,
"y":86.9090909090909
},
{
"height":7.09090909090909,
"id":24,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16.3636363636364,
"x":127.636363636364,
"y":80
},
{
"height":12.5454545454545,
"id":25,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":11.4545454545455,
"x":114.363636363636,
"y":111.818181818182
},
{
"height":12.5454545454545,
"id":26,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":12.1818181818182,
"x":145.090909090909,
"y":111.272727272727
},
{
"height":6.54545454545453,
"id":27,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":31.0909090909091,
"x":0.363636363636364,
"y":153.272727272727
},
{
"height":7.09090909090909,
"id":28,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":8.90909090909091,
"x":11.2727272727273,
"y":146.181818181818
},
{
"height":5.81818181818181,
"id":29,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":8,
"x":51.8181818181818,
"y":154
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":3,
"name":"act",
"objects":[
{
"height":20,
"id":30,
"name":"sign",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Test message!"
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":16,
"y":96
},
{
"height":16,
"id":31,
"name":"gravestone 1",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"type":"",
"visible":true,
"width":7,
"x":82.64,
"y":103
},
{
"height":16,
"id":32,
"name":"gravestone 2",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Moar ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"type":"",
"visible":true,
"width":7,
"x":96.18,
"y":103.36
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":4,
"name":"spc",
"objects":[
{
"height":16,
"id":33,
"name":"mara_start",
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":32,
"y":128
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
}],
"nextlayerid":5,
"nextobjectid":34,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.4.3",
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"source":"..\/sprites\/kenney_rpg.tsx"
}],
"tilewidth":16,
"type":"map",
"version":1.4,
"width":10
{ "compressionlevel":-1,
"height":10,
"infinite":false,
"layers":[
{
"data":[1, 1, 1, 18, 1, 19, 20, 21, 1, 18,
69, 1, 35, 52, 1, 36, 53, 38, 35, 52,
1, 18, 1, 18, 86, 88, 104, 1, 18, 17,
35, 52, 35, 52, 105, 1, 18, 35, 92, 1,
18, 69, 1, 1, 105, 35, 52, 1, 81, 1,
52, 35, 1, 18, 105, 67, 66, 97, 98, 99,
1, 68, 35, 52, 105, 66, 67, 114, 115, 116,
18, 103, 88, 88, 106, 1, 1, 100, 118, 101,
52, 1, 1, 1, 103, 88, 88, 88, 107, 88,
11, 13, 1, 12, 1, 69, 1, 18, 35, 52],
"height":10,
"id":1,
"name":"map",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":10,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":2,
"name":"coll",
"objects":[
{
"class":"",
"height":16.4512,
"id":1,
"name":"",
"rotation":0,
"visible":true,
"width":47.399,
"x":80.3013,
"y":-0.325766
},
{
"class":"",
"height":9.44722,
"id":6,
"name":"",
"rotation":0,
"visible":true,
"width":16.2883,
"x":127.863,
"y":70.3655
},
{
"class":"",
"height":15.8182,
"id":16,
"name":"",
"rotation":0,
"visible":true,
"width":11.4545,
"x":146.182,
"y":32
},
{
"class":"",
"height":12.7273,
"id":17,
"name":"",
"rotation":0,
"visible":true,
"width":11.8182,
"x":18,
"y":97.8182
},
{
"class":"",
"height":13.4545,
"id":18,
"name":"",
"rotation":0,
"visible":true,
"width":12,
"x":113.818,
"y":16.3636
},
{
"class":"",
"height":14.5455,
"id":19,
"name":"",
"rotation":0,
"visible":true,
"width":13.0909,
"x":81.2727,
"y":16.3636
},
{
"class":"",
"height":26.7273,
"id":20,
"name":"",
"rotation":0,
"visible":true,
"width":26,
"x":82.9091,
"y":85.2727
},
{
"class":"",
"height":4.54545,
"id":21,
"name":"",
"rotation":0,
"visible":true,
"width":8.18182,
"x":99.6364,
"y":80.9091
},
{
"class":"",
"height":17.2727,
"id":22,
"name":"",
"rotation":0,
"visible":true,
"width":47.6364,
"x":112,
"y":94.1818
},
{
"class":"",
"height":7.27273,
"id":23,
"name":"",
"rotation":0,
"visible":true,
"width":30.3636,
"x":120.727,
"y":86.9091
},
{
"class":"",
"height":7.09091,
"id":24,
"name":"",
"rotation":0,
"visible":true,
"width":16.3636,
"x":127.636,
"y":80
},
{
"class":"",
"height":12.5455,
"id":25,
"name":"",
"rotation":0,
"visible":true,
"width":11.4545,
"x":114.364,
"y":111.818
},
{
"class":"",
"height":12.5455,
"id":26,
"name":"",
"rotation":0,
"visible":true,
"width":12.1818,
"x":145.091,
"y":111.273
},
{
"class":"",
"height":6.54545,
"id":27,
"name":"",
"rotation":0,
"visible":true,
"width":31.0909,
"x":0.363636,
"y":153.273
},
{
"class":"",
"height":7.09091,
"id":28,
"name":"",
"rotation":0,
"visible":true,
"width":8.90909,
"x":11.2727,
"y":146.182
},
{
"class":"",
"height":5.81818,
"id":29,
"name":"",
"rotation":0,
"visible":true,
"width":8,
"x":51.8182,
"y":154
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":3,
"name":"act",
"objects":[
{
"class":"",
"height":20,
"id":30,
"name":"sign",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Test message!"
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":16,
"x":16,
"y":96
},
{
"class":"",
"height":16,
"id":31,
"name":"gravestone 1",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":7,
"x":82.64,
"y":103
},
{
"class":"",
"height":16,
"id":32,
"name":"gravestone 2",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Moar ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":7,
"x":96.18,
"y":103.36
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":4,
"name":"spc",
"objects":[
{
"class":"",
"height":16,
"id":33,
"name":"mara_start",
"rotation":0,
"visible":true,
"width":16,
"x":32,
"y":32
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
}],
"nextlayerid":5,
"nextobjectid":34,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.9.0",
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"source":"..\/sprites\/kenney_rpg.tsx"
}],
"tilewidth":16,
"type":"map",
"version":"1.9",
"width":10
}

View File

@ -1,62 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="34">
<editorsettings>
<export target="RPGmap.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../sprites/kenney_rpg.tsx"/>
<layer id="1" name="map" width="10" height="10">
<data encoding="csv">
1,1,1,18,1,19,20,21,1,18,
69,1,35,52,1,36,53,38,35,52,
1,18,1,18,86,88,104,1,18,17,
35,52,35,52,105,1,18,35,92,1,
18,69,1,1,105,35,52,1,81,1,
52,35,1,18,105,67,66,97,98,99,
1,68,35,52,105,66,67,114,115,116,
18,103,88,88,106,1,1,100,118,101,
52,1,1,1,103,88,88,88,107,88,
11,13,1,12,1,69,1,18,35,52
</data>
</layer>
<objectgroup id="2" name="coll">
<object id="1" x="80.3013" y="-0.325766" width="47.399" height="16.4512"/>
<object id="6" x="127.863" y="70.3655" width="16.2883" height="9.44722"/>
<object id="16" x="146.182" y="32" width="11.4545" height="15.8182"/>
<object id="17" x="18" y="97.8182" width="11.8182" height="12.7273"/>
<object id="18" x="113.818" y="16.3636" width="12" height="13.4545"/>
<object id="19" x="81.2727" y="16.3636" width="13.0909" height="14.5455"/>
<object id="20" x="82.9091" y="85.2727" width="26" height="26.7273"/>
<object id="21" x="99.6364" y="80.9091" width="8.18182" height="4.54545"/>
<object id="22" x="112" y="94.1818" width="47.6364" height="17.2727"/>
<object id="23" x="120.727" y="86.9091" width="30.3636" height="7.27273"/>
<object id="24" x="127.636" y="80" width="16.3636" height="7.09091"/>
<object id="25" x="114.364" y="111.818" width="11.4545" height="12.5455"/>
<object id="26" x="145.091" y="111.273" width="12.1818" height="12.5455"/>
<object id="27" x="0.363636" y="153.273" width="31.0909" height="6.54545"/>
<object id="28" x="11.2727" y="146.182" width="8.90909" height="7.09091"/>
<object id="29" x="51.8182" y="154" width="8" height="5.81818"/>
</objectgroup>
<objectgroup id="3" name="act">
<object id="30" name="sign" x="16" y="96" width="16" height="20">
<properties>
<property name="dialogue" value="Test message!"/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="31" name="gravestone 1" x="82.64" y="103" width="7" height="16">
<properties>
<property name="dialogue" value="Ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="32" name="gravestone 2" x="96.18" y="103.36" width="7" height="16">
<properties>
<property name="dialogue" value="Moar ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
</objectgroup>
<objectgroup id="4" name="spc">
<object id="33" name="mara_start" x="32" y="128" width="16" height="16"/>
</objectgroup>
</map>
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.9" tiledversion="1.9.0" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="34">
<editorsettings>
<export target="RPGmap.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../sprites/kenney_rpg.tsx"/>
<layer id="1" name="map" width="10" height="10">
<data encoding="csv">
1,1,1,18,1,19,20,21,1,18,
69,1,35,52,1,36,53,38,35,52,
1,18,1,18,86,88,104,1,18,17,
35,52,35,52,105,1,18,35,92,1,
18,69,1,1,105,35,52,1,81,1,
52,35,1,18,105,67,66,97,98,99,
1,68,35,52,105,66,67,114,115,116,
18,103,88,88,106,1,1,100,118,101,
52,1,1,1,103,88,88,88,107,88,
11,13,1,12,1,69,1,18,35,52
</data>
</layer>
<objectgroup id="2" name="coll">
<object id="1" x="80.3013" y="-0.325766" width="47.399" height="16.4512"/>
<object id="6" x="127.863" y="70.3655" width="16.2883" height="9.44722"/>
<object id="16" x="146.182" y="32" width="11.4545" height="15.8182"/>
<object id="17" x="18" y="97.8182" width="11.8182" height="12.7273"/>
<object id="18" x="113.818" y="16.3636" width="12" height="13.4545"/>
<object id="19" x="81.2727" y="16.3636" width="13.0909" height="14.5455"/>
<object id="20" x="82.9091" y="85.2727" width="26" height="26.7273"/>
<object id="21" x="99.6364" y="80.9091" width="8.18182" height="4.54545"/>
<object id="22" x="112" y="94.1818" width="47.6364" height="17.2727"/>
<object id="23" x="120.727" y="86.9091" width="30.3636" height="7.27273"/>
<object id="24" x="127.636" y="80" width="16.3636" height="7.09091"/>
<object id="25" x="114.364" y="111.818" width="11.4545" height="12.5455"/>
<object id="26" x="145.091" y="111.273" width="12.1818" height="12.5455"/>
<object id="27" x="0.363636" y="153.273" width="31.0909" height="6.54545"/>
<object id="28" x="11.2727" y="146.182" width="8.90909" height="7.09091"/>
<object id="29" x="51.8182" y="154" width="8" height="5.81818"/>
</objectgroup>
<objectgroup id="3" name="act">
<object id="30" name="sign" x="16" y="96" width="16" height="20">
<properties>
<property name="dialogue" value="Test message!"/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="31" name="gravestone 1" x="82.64" y="103" width="7" height="16">
<properties>
<property name="dialogue" value="Ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="32" name="gravestone 2" x="96.18" y="103.36" width="7" height="16">
<properties>
<property name="dialogue" value="Moar ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
</objectgroup>
<objectgroup id="4" name="spc">
<object id="33" name="mara_start" x="32" y="32" width="16" height="16"/>
</objectgroup>
</map>

658
maps/rpgbig.json Normal file
View File

@ -0,0 +1,658 @@
{ "compressionlevel":-1,
"height":20,
"infinite":false,
"layers":[
{
"data":[1, 1, 1, 18, 1, 19, 20, 21, 1, 18, 1, 18, 19, 68, 21, 18, 1, 18, 20, 18,
69, 1, 35, 52, 1, 36, 53, 38, 35, 52, 35, 52, 19, 20, 21, 52, 35, 23, 81, 23,
1, 18, 1, 18, 86, 88, 104, 1, 18, 17, 1, 18, 36, 55, 38, 18, 1, 97, 115, 99,
35, 52, 35, 52, 105, 1, 18, 35, 92, 1, 35, 52, 1, 69, 20, 52, 35, 131, 80, 133,
18, 69, 1, 1, 105, 35, 52, 1, 81, 84, 1, 18, 1, 18, 1, 18, 1, 108, 110, 95,
52, 35, 1, 18, 105, 67, 66, 97, 98, 99, 35, 89, 88, 88, 88, 88, 88, 88, 107, 88,
1, 68, 35, 52, 105, 66, 67, 114, 115, 116, 1, 105, 1, 18, 1, 18, 1, 18, 1, 18,
18, 103, 88, 88, 106, 1, 1, 100, 118, 101, 35, 105, 35, 52, 35, 52, 35, 52, 35, 52,
52, 1, 1, 1, 103, 88, 88, 88, 107, 88, 90, 104, 1, 18, 81, 18, 1, 69, 1, 18,
11, 13, 12, 12, 1, 69, 1, 18, 35, 52, 105, 52, 35, 97, 98, 99, 35, 52, 35, 52,
29, 29, 29, 29, 30, 18, 1, 18, 1, 18, 105, 18, 1, 114, 115, 116, 1, 18, 1, 18,
29, 29, 29, 47, 35, 52, 35, 52, 35, 52, 105, 52, 35, 100, 118, 101, 84, 20, 69, 52,
45, 47, 46, 18, 1, 57, 73, 73, 58, 18, 103, 88, 88, 88, 107, 87, 1, 18, 1, 18,
35, 52, 35, 52, 35, 56, 23, 69, 56, 52, 35, 52, 35, 52, 35, 105, 35, 52, 35, 52,
1, 18, 1, 18, 1, 74, 73, 73, 75, 18, 1, 18, 1, 18, 1, 105, 1, 18, 1, 18,
35, 52, 35, 52, 35, 52, 35, 52, 35, 52, 35, 52, 35, 69, 35, 105, 35, 52, 35, 52,
1, 18, 1, 69, 1, 18, 1, 18, 86, 88, 87, 18, 1, 18, 1, 105, 1, 69, 1, 18,
35, 52, 35, 52, 35, 52, 35, 52, 105, 68, 105, 52, 35, 52, 35, 105, 35, 52, 35, 52,
1, 18, 1, 18, 1, 18, 1, 18, 103, 88, 107, 88, 88, 88, 88, 107, 88, 88, 88, 88,
35, 69, 35, 52, 35, 52, 35, 52, 35, 52, 35, 69, 35, 52, 35, 52, 35, 52, 35, 52],
"height":20,
"id":1,
"name":"map",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":20,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":2,
"name":"coll",
"objects":[
{
"class":"",
"height":16.4512,
"id":1,
"name":"",
"rotation":0,
"visible":true,
"width":47.399,
"x":80.3013,
"y":-0.325766
},
{
"class":"",
"height":9.44722,
"id":6,
"name":"",
"rotation":0,
"visible":true,
"width":16.2883,
"x":127.863,
"y":70.3655
},
{
"class":"",
"height":15.8182,
"id":16,
"name":"",
"rotation":0,
"visible":true,
"width":11.4545,
"x":146.182,
"y":32
},
{
"class":"",
"height":12.7273,
"id":17,
"name":"",
"rotation":0,
"visible":true,
"width":11.8182,
"x":18,
"y":97.8182
},
{
"class":"",
"height":13.4545,
"id":18,
"name":"",
"rotation":0,
"visible":true,
"width":12,
"x":113.818,
"y":16.3636
},
{
"class":"",
"height":14.5455,
"id":19,
"name":"",
"rotation":0,
"visible":true,
"width":13.0909,
"x":81.2727,
"y":16.3636
},
{
"class":"",
"height":26.7273,
"id":20,
"name":"",
"rotation":0,
"visible":true,
"width":26,
"x":82.9091,
"y":85.2727
},
{
"class":"",
"height":4.54545,
"id":21,
"name":"",
"rotation":0,
"visible":true,
"width":8.18182,
"x":99.6364,
"y":80.9091
},
{
"class":"",
"height":17.2727,
"id":22,
"name":"",
"rotation":0,
"visible":true,
"width":47.6364,
"x":112,
"y":94.1818
},
{
"class":"",
"height":7.27273,
"id":23,
"name":"",
"rotation":0,
"visible":true,
"width":30.3636,
"x":120.727,
"y":86.9091
},
{
"class":"",
"height":7.09091,
"id":24,
"name":"",
"rotation":0,
"visible":true,
"width":16.3636,
"x":127.636,
"y":80
},
{
"class":"",
"height":12.5455,
"id":25,
"name":"",
"rotation":0,
"visible":true,
"width":11.4545,
"x":114.364,
"y":111.818
},
{
"class":"",
"height":12.5455,
"id":26,
"name":"",
"rotation":0,
"visible":true,
"width":12.1818,
"x":145.091,
"y":111.273
},
{
"class":"",
"height":6.54545,
"id":27,
"name":"",
"rotation":0,
"visible":true,
"width":31.0909,
"x":0.363636,
"y":153.273
},
{
"class":"",
"height":7.09091,
"id":28,
"name":"",
"rotation":0,
"visible":true,
"width":8.90909,
"x":11.2727,
"y":146.182
},
{
"class":"",
"height":5.81818,
"id":29,
"name":"",
"rotation":0,
"visible":true,
"width":8,
"x":51.8182,
"y":154
},
{
"class":"",
"height":26.95908776276,
"id":34,
"name":"",
"rotation":0,
"visible":true,
"width":32.0594557178768,
"x":31.6951437210827,
"y":153.739662647091
},
{
"class":"",
"height":14.7546358701592,
"id":35,
"name":"",
"rotation":0,
"visible":true,
"width":6.37545994389595,
"x":64.1189114357536,
"y":160.843746584575
},
{
"class":"",
"height":20.21931582207,
"id":36,
"name":"",
"rotation":0,
"visible":true,
"width":31.5129877226857,
"x":0,
"y":160.479434587781
},
{
"class":"",
"height":16.7583518525265,
"id":37,
"name":"",
"rotation":0,
"visible":true,
"width":47.1784035848301,
"x":0.546467995191082,
"y":181.791686400233
},
{
"class":"",
"height":9.28995591824838,
"id":38,
"name":"",
"rotation":0,
"visible":true,
"width":6.37545994389595,
"x":48.0891835768152,
"y":180.880906408248
},
{
"class":"",
"height":7.46839593427813,
"id":39,
"name":"",
"rotation":0,
"visible":true,
"width":13.47954388138,
"x":9.10779991985136,
"y":199.278662246348
},
{
"class":"",
"height":47.1784035848301,
"id":40,
"name":"",
"rotation":0,
"visible":true,
"width":63.0259754453714,
"x":80.6951072898831,
"y":192.356734307261
},
{
"class":"",
"height":6.37545994389598,
"id":41,
"name":"",
"rotation":0,
"visible":true,
"width":8.92564392145434,
"x":147.910670698386,
"y":276.148493569893
},
{
"class":"",
"height":7.2862399358811,
"id":42,
"name":"",
"rotation":0,
"visible":true,
"width":14.2081678749681,
"x":224.780502021932,
"y":136.434842799373
},
{
"class":"",
"height":15.78,
"id":43,
"name":"",
"rotation":0,
"visible":true,
"width":15.4832598637473,
"x":224.051878028343,
"y":144.996174724034
},
{
"class":"",
"height":8.01486392946919,
"id":44,
"name":"",
"rotation":0,
"visible":true,
"width":7.10408393748406,
"x":216.765638092462,
"y":151.189478669533
},
{
"class":"",
"height":16.0297278589384,
"id":45,
"name":"",
"rotation":0,
"visible":true,
"width":45.5389995992568,
"x":209.479398156581,
"y":159.93296659259
},
{
"class":"",
"height":6.19330394549894,
"id":46,
"name":"",
"rotation":0,
"visible":true,
"width":7.65055193267514,
"x":240.263761885679,
"y":152.828882655106
},
{
"class":"",
"height":12.7509198877919,
"id":48,
"name":"",
"rotation":0,
"visible":true,
"width":13.297387882983,
"x":209.297242158184,
"y":177.05563044191
},
{
"class":"",
"height":12.5687638893949,
"id":49,
"name":"",
"rotation":0,
"visible":true,
"width":12.5687638893949,
"x":241.903165871252,
"y":177.237786440308
},
{
"class":"",
"height":8.92564392145434,
"id":51,
"name":"",
"rotation":0,
"visible":true,
"width":11.1115159022187,
"x":194.360450289628,
"y":37.7062916681846
},
{
"class":"",
"height":7.83270793107216,
"id":52,
"name":"",
"rotation":0,
"visible":true,
"width":11.1115159022187,
"x":227.148530001093,
"y":38.4349156617727
},
{
"class":"",
"height":44.0817516120806,
"id":54,
"name":"",
"rotation":0,
"visible":true,
"width":1,
"x":192.174578308864,
"y":0
},
{
"class":"",
"height":43.1709716200955,
"id":55,
"name":"",
"rotation":0,
"visible":true,
"width":1,
"x":238.624357900106,
"y":0
},
{
"class":"",
"height":15.5440414507772,
"id":58,
"name":"",
"rotation":0,
"visible":true,
"width":45.3367875647669,
"x":273.316062176166,
"y":47.6683937823834
},
{
"class":"",
"height":14.2487046632124,
"id":59,
"name":"",
"rotation":0,
"visible":true,
"width":12.1761658031088,
"x":273.575129533679,
"y":64.5077720207254
},
{
"class":"",
"height":14.7668393782384,
"id":60,
"name":"",
"rotation":0,
"visible":true,
"width":12.6943005181348,
"x":306.217616580311,
"y":63.7305699481865
},
{
"class":"",
"height":5.44041450777203,
"id":61,
"name":"",
"rotation":0,
"visible":true,
"width":34.7150259067357,
"x":279.015544041451,
"y":41.1917098445596
},
{
"class":"",
"height":8.03108808290155,
"id":62,
"name":"",
"rotation":0,
"visible":true,
"width":16.0621761658031,
"x":288.082901554404,
"y":32.3834196891192
},
{
"class":"",
"height":6.47668393782383,
"id":64,
"name":"",
"rotation":0,
"visible":true,
"width":13.9896373056995,
"x":289.378238341969,
"y":25.6476683937824
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":3,
"name":"act",
"objects":[
{
"class":"",
"height":20,
"id":30,
"name":"sign",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Test message!"
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":16,
"x":16,
"y":96
},
{
"class":"",
"height":16,
"id":31,
"name":"gravestone 1",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":7,
"x":82.64,
"y":103
},
{
"class":"",
"height":16,
"id":32,
"name":"gravestone 2",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Moar ded."
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":7,
"x":96.18,
"y":103.36
},
{
"class":"",
"height":22.7979274611399,
"id":56,
"name":"high sign",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Kahsis' Edge"
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":6.7357512953368,
"x":208.290155440415,
"y":1.03626943005181
},
{
"class":"",
"height":25.1295336787565,
"id":65,
"name":"Garden Sign",
"properties":[
{
"name":"dialogue",
"type":"string",
"value":"Check the\\ndungeons!"
},
{
"name":"direction",
"type":"string",
"value":"Up"
}],
"rotation":0,
"visible":true,
"width":12.9533678756477,
"x":145.077720207254,
"y":272.279792746114
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":4,
"name":"spc",
"objects":[
{
"class":"",
"height":16,
"id":33,
"name":"mara_start",
"rotation":0,
"visible":true,
"width":16,
"x":32,
"y":32
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
}],
"nextlayerid":5,
"nextobjectid":66,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.9.0",
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"source":"..\/sprites\/kenney_rpg.tsx"
}],
"tilewidth":16,
"type":"map",
"version":"1.9",
"width":20
}

View File

@ -1,62 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="20" height="10" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="34">
<editorsettings>
<export target="RPGmap.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../sprites/kenney_rpg.tsx"/>
<layer id="1" name="map" width="20" height="10">
<data encoding="csv">
1,1,1,18,1,19,20,21,1,18,1,18,1,18,1,18,1,18,81,18,
69,1,35,52,1,36,53,38,35,52,35,52,35,52,35,52,35,97,98,99,
1,18,1,18,86,88,104,1,18,17,1,18,1,18,1,18,1,114,115,116,
35,52,35,52,105,1,18,35,92,1,35,52,35,52,35,52,35,131,132,133,
18,69,1,1,105,35,52,1,81,1,1,18,1,18,1,18,1,108,110,109,
52,35,1,18,105,67,66,97,98,99,35,52,35,52,35,52,35,52,35,52,
1,68,35,52,105,66,67,114,115,116,1,18,1,18,1,18,1,18,1,18,
18,103,88,88,106,1,1,100,118,101,35,52,35,52,35,52,35,52,35,52,
52,1,1,1,103,88,88,88,107,88,1,18,1,18,1,18,1,18,1,18,
11,13,1,12,1,69,1,18,35,52,35,52,35,52,35,52,35,52,35,52
</data>
</layer>
<objectgroup id="2" name="coll">
<object id="1" x="80.3013" y="-0.325766" width="47.399" height="16.4512"/>
<object id="6" x="127.863" y="70.3655" width="16.2883" height="9.44722"/>
<object id="16" x="146.182" y="32" width="11.4545" height="15.8182"/>
<object id="17" x="18" y="97.8182" width="11.8182" height="12.7273"/>
<object id="18" x="113.818" y="16.3636" width="12" height="13.4545"/>
<object id="19" x="81.2727" y="16.3636" width="13.0909" height="14.5455"/>
<object id="20" x="82.9091" y="85.2727" width="26" height="26.7273"/>
<object id="21" x="99.6364" y="80.9091" width="8.18182" height="4.54545"/>
<object id="22" x="112" y="94.1818" width="47.6364" height="17.2727"/>
<object id="23" x="120.727" y="86.9091" width="30.3636" height="7.27273"/>
<object id="24" x="127.636" y="80" width="16.3636" height="7.09091"/>
<object id="25" x="114.364" y="111.818" width="11.4545" height="12.5455"/>
<object id="26" x="145.091" y="111.273" width="12.1818" height="12.5455"/>
<object id="27" x="0.363636" y="153.273" width="31.0909" height="6.54545"/>
<object id="28" x="11.2727" y="146.182" width="8.90909" height="7.09091"/>
<object id="29" x="51.8182" y="154" width="8" height="5.81818"/>
</objectgroup>
<objectgroup id="3" name="act">
<object id="30" name="sign" x="16" y="96" width="16" height="20">
<properties>
<property name="dialogue" value="Test message!"/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="31" name="gravestone 1" x="82.64" y="103" width="7" height="16">
<properties>
<property name="dialogue" value="Ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="32" name="gravestone 2" x="96.18" y="103.36" width="7" height="16">
<properties>
<property name="dialogue" value="Moar ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
</objectgroup>
<objectgroup id="4" name="spc">
<object id="33" name="mara_start" x="32" y="128" width="16" height="16"/>
</objectgroup>
</map>
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.9" tiledversion="1.9.0" orientation="orthogonal" renderorder="right-down" width="20" height="20" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="66">
<editorsettings>
<export target="rpgbig.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../sprites/kenney_rpg.tsx"/>
<layer id="1" name="map" width="20" height="20">
<data encoding="csv">
1,1,1,18,1,19,20,21,1,18,1,18,19,68,21,18,1,18,20,18,
69,1,35,52,1,36,53,38,35,52,35,52,19,20,21,52,35,23,81,23,
1,18,1,18,86,88,104,1,18,17,1,18,36,55,38,18,1,97,115,99,
35,52,35,52,105,1,18,35,92,1,35,52,1,69,20,52,35,131,80,133,
18,69,1,1,105,35,52,1,81,84,1,18,1,18,1,18,1,108,110,95,
52,35,1,18,105,67,66,97,98,99,35,89,88,88,88,88,88,88,107,88,
1,68,35,52,105,66,67,114,115,116,1,105,1,18,1,18,1,18,1,18,
18,103,88,88,106,1,1,100,118,101,35,105,35,52,35,52,35,52,35,52,
52,1,1,1,103,88,88,88,107,88,90,104,1,18,81,18,1,69,1,18,
11,13,12,12,1,69,1,18,35,52,105,52,35,97,98,99,35,52,35,52,
29,29,29,29,30,18,1,18,1,18,105,18,1,114,115,116,1,18,1,18,
29,29,29,47,35,52,35,52,35,52,105,52,35,100,118,101,84,20,69,52,
45,47,46,18,1,57,73,73,58,18,103,88,88,88,107,87,1,18,1,18,
35,52,35,52,35,56,23,69,56,52,35,52,35,52,35,105,35,52,35,52,
1,18,1,18,1,74,73,73,75,18,1,18,1,18,1,105,1,18,1,18,
35,52,35,52,35,52,35,52,35,52,35,52,35,69,35,105,35,52,35,52,
1,18,1,69,1,18,1,18,86,88,87,18,1,18,1,105,1,69,1,18,
35,52,35,52,35,52,35,52,105,68,105,52,35,52,35,105,35,52,35,52,
1,18,1,18,1,18,1,18,103,88,107,88,88,88,88,107,88,88,88,88,
35,69,35,52,35,52,35,52,35,52,35,69,35,52,35,52,35,52,35,52
</data>
</layer>
<objectgroup id="2" name="coll">
<object id="1" x="80.3013" y="-0.325766" width="47.399" height="16.4512"/>
<object id="6" x="127.863" y="70.3655" width="16.2883" height="9.44722"/>
<object id="16" x="146.182" y="32" width="11.4545" height="15.8182"/>
<object id="17" x="18" y="97.8182" width="11.8182" height="12.7273"/>
<object id="18" x="113.818" y="16.3636" width="12" height="13.4545"/>
<object id="19" x="81.2727" y="16.3636" width="13.0909" height="14.5455"/>
<object id="20" x="82.9091" y="85.2727" width="26" height="26.7273"/>
<object id="21" x="99.6364" y="80.9091" width="8.18182" height="4.54545"/>
<object id="22" x="112" y="94.1818" width="47.6364" height="17.2727"/>
<object id="23" x="120.727" y="86.9091" width="30.3636" height="7.27273"/>
<object id="24" x="127.636" y="80" width="16.3636" height="7.09091"/>
<object id="25" x="114.364" y="111.818" width="11.4545" height="12.5455"/>
<object id="26" x="145.091" y="111.273" width="12.1818" height="12.5455"/>
<object id="27" x="0.363636" y="153.273" width="31.0909" height="6.54545"/>
<object id="28" x="11.2727" y="146.182" width="8.90909" height="7.09091"/>
<object id="29" x="51.8182" y="154" width="8" height="5.81818"/>
<object id="34" x="31.6951" y="153.74" width="32.0595" height="26.9591"/>
<object id="35" x="64.1189" y="160.844" width="6.37546" height="14.7546"/>
<object id="36" x="0" y="160.479" width="31.513" height="20.2193"/>
<object id="37" x="0.546468" y="181.792" width="47.1784" height="16.7584"/>
<object id="38" x="48.0892" y="180.881" width="6.37546" height="9.28996"/>
<object id="39" x="9.1078" y="199.279" width="13.4795" height="7.4684"/>
<object id="40" x="80.6951" y="192.357" width="63.026" height="47.1784"/>
<object id="41" x="147.911" y="276.148" width="8.92564" height="6.37546"/>
<object id="42" x="224.781" y="136.435" width="14.2082" height="7.28624"/>
<object id="43" x="224.052" y="144.996" width="15.4833" height="15.78"/>
<object id="44" x="216.766" y="151.189" width="7.10408" height="8.01486"/>
<object id="45" x="209.479" y="159.933" width="45.539" height="16.0297"/>
<object id="46" x="240.264" y="152.829" width="7.65055" height="6.1933"/>
<object id="48" x="209.297" y="177.056" width="13.2974" height="12.7509"/>
<object id="49" x="241.903" y="177.238" width="12.5688" height="12.5688"/>
<object id="51" x="194.36" y="37.7063" width="11.1115" height="8.92564"/>
<object id="52" x="227.149" y="38.4349" width="11.1115" height="7.83271"/>
<object id="54" x="192.175" y="0" width="1" height="44.0818"/>
<object id="55" x="238.624" y="0" width="1" height="43.171"/>
<object id="58" x="273.316" y="47.6684" width="45.3368" height="15.544"/>
<object id="59" x="273.575" y="64.5078" width="12.1762" height="14.2487"/>
<object id="60" x="306.218" y="63.7306" width="12.6943" height="14.7668"/>
<object id="61" x="279.016" y="41.1917" width="34.715" height="5.44041"/>
<object id="62" x="288.083" y="32.3834" width="16.0622" height="8.03109"/>
<object id="64" x="289.378" y="25.6477" width="13.9896" height="6.47668"/>
</objectgroup>
<objectgroup id="3" name="act">
<object id="30" name="sign" x="16" y="96" width="16" height="20">
<properties>
<property name="dialogue" value="Test message!"/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="31" name="gravestone 1" x="82.64" y="103" width="7" height="16">
<properties>
<property name="dialogue" value="Ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="32" name="gravestone 2" x="96.18" y="103.36" width="7" height="16">
<properties>
<property name="dialogue" value="Moar ded."/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="56" name="high sign" x="208.29" y="1.03627" width="6.73575" height="22.7979">
<properties>
<property name="dialogue" value="Kahsis' Edge"/>
<property name="direction" value="Up"/>
</properties>
</object>
<object id="65" name="Garden Sign" x="145.078" y="272.28" width="12.9534" height="25.1295">
<properties>
<property name="dialogue" value="Check the\ndungeons!"/>
<property name="direction" value="Up"/>
</properties>
</object>
</objectgroup>
<objectgroup id="4" name="spc">
<object id="33" name="mara_start" x="32" y="32" width="16" height="16"/>
</objectgroup>
</map>

View File

@ -1,8 +1,8 @@
const w4 = @import("wasm4.zig");
const sh0rk = @import("sh0rk.zig");
const sprites = @import("sprites.zig");
const palette = @import("palette.zig");
const tframe = @import("tframe.zig");
const w4 = @import("./wasm4.zig");
const sh0rk = @import("./sh0rk.zig");
const sprites = @import("./sprites.zig");
const palette = @import("./palette.zig");
const tframe = @import("./tframe.zig");
const std = @import("std");
const fmt = std.fmt;
@ -17,9 +17,13 @@ var frame_count: u32 = 0;
var mara_direction: Direction = Direction.Right;
var mara_frame: bool = false;
var mara_box: Rect = Rect{.base = map.start_point, .width = 16, .height = 16};
var mara_speed: i32 = 0;
var mara_speed: u16 = 0;
var screen = Rect{.base = Point{.x = 0, .y = 0}, .width = 160, .height = 160};
const screen_width = 10;
const screen_height = 10;
var camera: [screen_height * screen_width]u8 = [_]u8{0} ** (screen_height * screen_width);
var sound_timer: u8 = 0;
var textBuf: [160]u8 = undefined;
@ -27,8 +31,17 @@ var done: bool = true;
export fn start() void {
palette.mist();
}
var col: u32 = 0;
while(col < screen_width) {
defer col += 1;
var row: u32 = 0;
while(row < screen_height) {
defer row += 1;
camera[row * screen_width + col] = map.data[row * screen_width + col];
}
}
}
fn bonk() void {
if (sound_timer != 0) {
@ -56,9 +69,6 @@ fn bonk() void {
sound_timer = 12;
}
const screen_width = 10;
const screen_height = 10;
fn drawMap() !void {
w4.m.colors.* = .{
._0 = .p3,
@ -75,7 +85,7 @@ fn drawMap() !void {
while (row < screen_height) {
defer row += 1;
var tile = map.data[col * map.width + row];
var tile = camera[col * map.width + row];
var tileX = tile % map.ts_width;
var tileY = tile / map.ts_width;
@ -100,9 +110,8 @@ fn drawMap() !void {
}
fn move_mara(gamepad: w4.GamePad) void {
mara_speed -= 1;
if (mara_speed < 0) {
mara_speed = 0;
if (mara_speed > 0) {
mara_speed -= 1;
}
if (gamepad.up) {
mara_direction = Direction.Up;

View File

@ -50,5 +50,5 @@ pub const triggers = [_]Trigger{
Trigger{.aura = Rect{.base = Point{.x = 96, .y = 103}, .width = 7, .height = 16}, .direction = Direction.Up, .dialogue = "Moar ded."}, // gravestone 2
};
pub const start_point = Point{ .x = 32, .y = 128 };
pub const start_point = Point{ .x = 32, .y = 32 };

111
src/maps/rpgbig.zig Normal file
View File

@ -0,0 +1,111 @@
// Generated by ./src/tools/genmap.js ./maps/rpgbig.json, DO NOT EDIT
const sh0rk = @import("../sh0rk.zig");
const Direction = sh0rk.Direction;
const Point = sh0rk.Point;
const Trigger = sh0rk.Trigger;
const Rect = sh0rk.Rect;
pub const width = 20;
pub const height = 20;
pub const ts_width = 17;
pub const ts_height = 8;
pub const data = [400]u8{
0, 0, 0, 17, 0, 18, 19, 20, 0, 17, 0,
17, 18, 67, 20, 17, 0, 17, 19, 17, 68,
0, 34, 51, 0, 35, 52, 37, 34, 51, 34,
51, 18, 19, 20, 51, 34, 22, 80, 22, 0,
17, 0, 17, 85, 87, 103, 0, 17, 16, 0,
17, 35, 54, 37, 17, 0, 96, 114, 98, 34,
51, 34, 51, 104, 0, 17, 34, 91, 0, 34,
51, 0, 68, 19, 51, 34, 130, 79, 132, 17,
68, 0, 0, 104, 34, 51, 0, 80, 83, 0,
17, 0, 17, 0, 17, 0, 107, 109, 94, 51,
34, 0, 17, 104, 66, 65, 96, 97, 98, 34,
88, 87, 87, 87, 87, 87, 87, 106, 87, 0,
67, 34, 51, 104, 65, 66, 113, 114, 115, 0,
104, 0, 17, 0, 17, 0, 17, 0, 17, 17,
102, 87, 87, 105, 0, 0, 99, 117, 100, 34,
104, 34, 51, 34, 51, 34, 51, 34, 51, 51,
0, 0, 0, 102, 87, 87, 87, 106, 87, 89,
103, 0, 17, 80, 17, 0, 68, 0, 17, 10,
12, 11, 11, 0, 68, 0, 17, 34, 51, 104,
51, 34, 96, 97, 98, 34, 51, 34, 51, 28,
28, 28, 28, 29, 17, 0, 17, 0, 17, 104,
17, 0, 113, 114, 115, 0, 17, 0, 17, 28,
28, 28, 46, 34, 51, 34, 51, 34, 51, 104,
51, 34, 99, 117, 100, 83, 19, 68, 51, 44,
46, 45, 17, 0, 56, 72, 72, 57, 17, 102,
87, 87, 87, 106, 86, 0, 17, 0, 17, 34,
51, 34, 51, 34, 55, 22, 68, 55, 51, 34,
51, 34, 51, 34, 104, 34, 51, 34, 51, 0,
17, 0, 17, 0, 73, 72, 72, 74, 17, 0,
17, 0, 17, 0, 104, 0, 17, 0, 17, 34,
51, 34, 51, 34, 51, 34, 51, 34, 51, 34,
51, 34, 68, 34, 104, 34, 51, 34, 51, 0,
17, 0, 68, 0, 17, 0, 17, 85, 87, 86,
17, 0, 17, 0, 104, 0, 68, 0, 17, 34,
51, 34, 51, 34, 51, 34, 51, 104, 67, 104,
51, 34, 51, 34, 104, 34, 51, 34, 51, 0,
17, 0, 17, 0, 17, 0, 17, 102, 87, 106,
87, 87, 87, 87, 106, 87, 87, 87, 87, 34,
68, 34, 51, 34, 51, 34, 51, 34, 51, 34,
68, 34, 51, 34, 51, 34, 51, 34, 51,
};
pub const coll = [_]Rect{
Rect{.base = Point{.x = 80, .y = 0}, .width = 47, .height = 16},
Rect{.base = Point{.x = 128, .y = 70}, .width = 16, .height = 9},
Rect{.base = Point{.x = 146, .y = 32}, .width = 11, .height = 16},
Rect{.base = Point{.x = 18, .y = 98}, .width = 12, .height = 13},
Rect{.base = Point{.x = 114, .y = 16}, .width = 12, .height = 13},
Rect{.base = Point{.x = 81, .y = 16}, .width = 13, .height = 15},
Rect{.base = Point{.x = 83, .y = 85}, .width = 26, .height = 27},
Rect{.base = Point{.x = 100, .y = 81}, .width = 8, .height = 5},
Rect{.base = Point{.x = 112, .y = 94}, .width = 48, .height = 17},
Rect{.base = Point{.x = 121, .y = 87}, .width = 30, .height = 7},
Rect{.base = Point{.x = 128, .y = 80}, .width = 16, .height = 7},
Rect{.base = Point{.x = 114, .y = 112}, .width = 11, .height = 13},
Rect{.base = Point{.x = 145, .y = 111}, .width = 12, .height = 13},
Rect{.base = Point{.x = 0, .y = 153}, .width = 31, .height = 7},
Rect{.base = Point{.x = 11, .y = 146}, .width = 9, .height = 7},
Rect{.base = Point{.x = 52, .y = 154}, .width = 8, .height = 6},
Rect{.base = Point{.x = 32, .y = 154}, .width = 32, .height = 27},
Rect{.base = Point{.x = 64, .y = 161}, .width = 6, .height = 15},
Rect{.base = Point{.x = 0, .y = 160}, .width = 32, .height = 20},
Rect{.base = Point{.x = 1, .y = 182}, .width = 47, .height = 17},
Rect{.base = Point{.x = 48, .y = 181}, .width = 6, .height = 9},
Rect{.base = Point{.x = 9, .y = 199}, .width = 13, .height = 7},
Rect{.base = Point{.x = 81, .y = 192}, .width = 63, .height = 47},
Rect{.base = Point{.x = 148, .y = 276}, .width = 9, .height = 6},
Rect{.base = Point{.x = 225, .y = 136}, .width = 14, .height = 7},
Rect{.base = Point{.x = 224, .y = 145}, .width = 15, .height = 16},
Rect{.base = Point{.x = 217, .y = 151}, .width = 7, .height = 8},
Rect{.base = Point{.x = 209, .y = 160}, .width = 46, .height = 16},
Rect{.base = Point{.x = 240, .y = 153}, .width = 8, .height = 6},
Rect{.base = Point{.x = 209, .y = 177}, .width = 13, .height = 13},
Rect{.base = Point{.x = 242, .y = 177}, .width = 13, .height = 13},
Rect{.base = Point{.x = 194, .y = 38}, .width = 11, .height = 9},
Rect{.base = Point{.x = 227, .y = 38}, .width = 11, .height = 8},
Rect{.base = Point{.x = 192, .y = 0}, .width = 1, .height = 44},
Rect{.base = Point{.x = 239, .y = 0}, .width = 1, .height = 43},
Rect{.base = Point{.x = 273, .y = 48}, .width = 45, .height = 16},
Rect{.base = Point{.x = 274, .y = 65}, .width = 12, .height = 14},
Rect{.base = Point{.x = 306, .y = 64}, .width = 13, .height = 15},
Rect{.base = Point{.x = 279, .y = 41}, .width = 35, .height = 5},
Rect{.base = Point{.x = 288, .y = 32}, .width = 16, .height = 8},
Rect{.base = Point{.x = 289, .y = 26}, .width = 14, .height = 6},
};
pub const triggers = [_]Trigger{
Trigger{.aura = Rect{.base = Point{.x = 16, .y = 96}, .width = 16, .height = 20}, .direction = Direction.Up, .dialogue = "Test message!"}, // sign
Trigger{.aura = Rect{.base = Point{.x = 83, .y = 103}, .width = 7, .height = 16}, .direction = Direction.Up, .dialogue = "Ded."}, // gravestone 1
Trigger{.aura = Rect{.base = Point{.x = 96, .y = 103}, .width = 7, .height = 16}, .direction = Direction.Up, .dialogue = "Moar ded."}, // gravestone 2
Trigger{.aura = Rect{.base = Point{.x = 208, .y = 1}, .width = 7, .height = 23}, .direction = Direction.Up, .dialogue = "Kahsis' Edge"}, // high sign
Trigger{.aura = Rect{.base = Point{.x = 145, .y = 272}, .width = 13, .height = 25}, .direction = Direction.Up, .dialogue = "Check the\ndungeons!"}, // Garden Sign
};
pub const start_point = Point{ .x = 32, .y = 32 };

View File

@ -1,7 +1,7 @@
pub const Point = packed struct {
x: i32,
y: i32,
pub fn init(x: i32, y: i32) @This() {
x: u16,
y: u16,
pub fn init(x: u16, y: u16) @This() {
return @This() {
.x = x,
.y = y,
@ -15,9 +15,9 @@ pub const Point = packed struct {
pub const Rect = packed struct {
base: Point,
width: i32,
height: i32,
pub fn init(base: Point, width: i32, height: i32) @This() {
width: u8,
height: u8,
pub fn init(base: Point, width: u8, height: u8) @This() {
return @This() {
.base = base,
.width = width,

View File

@ -138,7 +138,6 @@ pub const BlitFlags = packed struct {
/// Copies pixels to the framebuffer.
pub fn blit(sprite: []const u8, x: u32, y: u32, width: u32, height: u32, flags: BlitFlags) void {
raw_api.blit(sprite.ptr, x, y, width, height, @bitCast(u32, flags));
}