From bd936662e9b2e33a0d538639fa61ec7a5fbe176e Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sat, 15 Jul 2023 15:14:15 +0100 Subject: Added starts 3 and 4 --- TODO.md | 1 + data/stage03.json | 153 +++++++++++++++++++++++++++++++++++++++++++++ data/stage04.json | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/data.h | 1 + src/game.c | 4 +- 5 files changed, 338 insertions(+), 2 deletions(-) create mode 100644 data/stage03.json create mode 100644 data/stage04.json diff --git a/TODO.md b/TODO.md index d639df5..a8c212e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,6 @@ # TODO +- extra live x10000 - level design! - sound - music: diff --git a/data/stage03.json b/data/stage03.json new file mode 100644 index 0000000..fa0bcd3 --- /dev/null +++ b/data/stage03.json @@ -0,0 +1,153 @@ +{ "compressionlevel":-1, + "height":23, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 1, 1, 1, 1, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 1, 1, 1, 1, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 5, 6, 24, 23, 24, 23, 24, 5, 6, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 43, 44, 43, 44, 3, 4, 5, 6, 3, 4, 3, 4, 3, 4, 3, 5, 6, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 23, 24, 45, 45, 45, 45, 23, 24, 61, 62, 61, 62, 23, 24, 45, 45, 45, 45, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 3, 4, 1, 2, 1, 1, 3, 4, 41, 42, 41, 42, 3, 4, 1, 1, 2, 1, 3, 4, 3, 4, 23, 24, 23, 24, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 5, 6, 23, 24, 23, 24, 23, 22, 23, 24, 23, 24, 61, 62, 61, 62, 5, 6, 23, 24, 22, 24, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 63, 64, 45, 45, 45, 45, 45, 45, 41, 42, 41, 42, 45, 45, 45, 45, 45, 45, 63, 64, 5, 6, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 23, 24, 4, 3, 4, 61, 62, 3, 4, 3, 5, 6, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 61, 62, 3, 4, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 41, 42, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 41, 42, 23, 24, 23, 24, 5, 6, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 4, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 23, 24, 23, 22, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 22, 24, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 3, 4, 5, 6, 3, 4, 3, 5, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 3, 4, 41, 42, 1, 1, 1, 1, 61, 62, 23, 24, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 23, 24, 23, 24, 23, 24, 23, 24, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 7, 8, 61, 62, 1, 1, 1, 1, 41, 42, 3, 4, 3, 22, 3, 4, 3, 4, 5, 6, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 22, 4, 27, 28, 41, 42, 1, 1, 1, 1, 61, 62, 43, 44, 43, 44, 43, 44, 43, 44, 43, 44, 3, 4, 3, 3, 3, 3, 5, 6, 3, 3, 4, 4, 43, 44, 43, 44, 43, 44, 43, 44, 43, 44, 61, 62, 1, 1, 1, 1, 41, 42, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,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topdown", + "id":3, + "name":"Entities", + "objects":[ + { + "height":16, + "id":1, + "name":"Player", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":272, + "y":144 + }, + { + "height":16, + "id":28, + "name":"Snake", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":96, + "y":96 + }, + { + "height":16, + "id":29, + "name":"Snake", + "properties":[ + { + "name":"dir", + "type":"string", + "value":"left" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":208, + "y":96 + }, + { + "height":16, + "id":32, + "name":"Bat", + "properties":[ + { + "name":"dir", + "type":"string", + "value":"left" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":256, + "y":72 + }, + { + "height":16, + "id":30, + "name":"Bonus", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":96, + "y":120 + }, + { + "height":16, + "id":31, + "name":"Bonus", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":208, + "y":120 + }, + { + "height":16, + "id":33, + "name":"Bat", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":48, + "y":72 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":4, + "nextobjectid":34, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.7.2", + "tileheight":8, + "tilesets":[ + { + "columns":20, + "firstgid":1, + "image":"tiles.png", + "imageheight":48, + "imagewidth":160, + "margin":0, + "name":"Map", + "spacing":0, + "tilecount":120, + "tileheight":8, + "tilewidth":8 + }], + "tilewidth":8, + "type":"map", + "version":"1.6", + "width":40 +} \ No newline at end of file diff --git a/data/stage04.json b/data/stage04.json new file mode 100644 index 0000000..d47423c --- /dev/null +++ b/data/stage04.json @@ -0,0 +1,181 @@ +{ "compressionlevel":-1, + "height":23, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 5, 6, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 43, 44, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 43, 44, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 5, 6, 3, 4, 61, 62, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 62, 3, 4, 5, 6, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 61, 62, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 3, 4, 3, 4, 61, 62, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 41, 42, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 41, 42, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 5, 6, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 23, 24, 23, 5, 6, 24, 22, 24, 23, 24, 23, 24, 23, 22, 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 63, 64, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 63, 64, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 5, 6, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 61, 62, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 61, 62, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 41, 42, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 41, 42, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 4, 3, 4, 61, 62, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 61, 62, 3, 4, 5, 6, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 23, 24, 23, 24, 41, 42, 5, 6, 23, 24, 22, 24, 23, 24, 23, 24, 23, 22, 23, 24, 23, 24, 41, 42, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 3, 5, 6, 4, 61, 62, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 62, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 7, 8, 23, 24, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 23, 24, 23, 24, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 27, 28, 3, 4, 3, 4, 22, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 22, 3, 4, 3, 4, 3, 4, 41, 42, 1, 1, 1, 1, 1, 1, 1, 1, 61, 62, 43, 44, 43, 44, 43, 44, 43, 44, 43, 44, 3, 4, 3, 4, 3, 5, 6, 4, 43, 44, 43, 44, 43, 44, 43, 44, 43, 44, 61, 62, 1, 1, 1, 1, 1, 1, 1, 1, 41, 42, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 101, 101, 101, 101, 101, 101, 101, 101, 61, 62, 61, 62, 61, 62, 61, 62, 61, 62, 41, 42, 1, 1, 1, 1], + "height":23, + "id":1, + "name":"Map", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":40, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":23, + "id":2, + "name":"Gold", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":40, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":3, + "name":"Entities", + "objects":[ + { + "height":16, + "id":1, + "name":"Player", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":48, + "y":152 + }, + { + "height":16, + "id":28, + "name":"Snake", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":96, + "y":128 + }, + { + "height":16, + "id":33, + "name":"Bat", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":56, + "y":80 + }, + { + "height":16, + "id":29, + "name":"Snake", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":96, + "y":56 + }, + { + "height":16, + "id":34, + "name":"Bonus", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":80, + "y":24 + }, + { + "height":16, + "id":35, + "name":"Bonus", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":224, + "y":152 + }, + { + "height":16, + "id":30, + "name":"Snake", + "properties":[ + { + "name":"dir", + "type":"string", + "value":"left" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":208, + "y":104 + }, + { + "height":16, + "id":31, + "name":"Snake", + "properties":[ + { + "name":"dir", + "type":"string", + "value":"left" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":208, + "y":32 + }, + { + "height":16, + "id":32, + "name":"Bat", + "properties":[ + { + "name":"dir", + "type":"string", + "value":"left" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":248, + "y":80 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":4, + "nextobjectid":36, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.7.2", + "tileheight":8, + "tilesets":[ + { + "columns":20, + "firstgid":1, + "image":"tiles.png", + "imageheight":48, + "imagewidth":160, + "margin":0, + "name":"Map", + "spacing":0, + "tilecount":120, + "tileheight":8, + "tilewidth":8 + }], + "tilewidth":8, + "type":"map", + "version":"1.6", + "width":40 +} \ No newline at end of file diff --git a/src/data.h b/src/data.h index 1d9a351..59fa913 100644 --- a/src/data.h +++ b/src/data.h @@ -17,6 +17,7 @@ extern const uint8_t binary_intro_start[]; extern const uint8_t binary_stage01_start[]; extern const uint8_t binary_stage02_start[]; extern const uint8_t binary_stage03_start[]; +extern const uint8_t binary_stage04_start[]; /* sound */ extern const uint8_t binary_music_start[]; diff --git a/src/game.c b/src/game.c index 6f17c51..bfec08f 100644 --- a/src/game.c +++ b/src/game.c @@ -48,10 +48,10 @@ static uint8_t gameover; static uint8_t pause; static Entity *tmonster; -#define STAGES_LEN 2 +#define STAGES_LEN 4 static const uint8_t *stages[STAGES_LEN] = { - binary_stage01_start, binary_stage02_start, + binary_stage01_start, binary_stage02_start, binary_stage03_start, binary_stage04_start }; static void hud_render() -- cgit v1.2.3