diff --git a/res/aseprite/example.aseprite b/res/aseprite/example.aseprite index d404fb2..2fb0c6a 100644 Binary files a/res/aseprite/example.aseprite and b/res/aseprite/example.aseprite differ diff --git a/res/aseprite/tilemap.aseprite b/res/aseprite/tilemap.aseprite index dd0ca0c..4eb1a5f 100644 Binary files a/res/aseprite/tilemap.aseprite and b/res/aseprite/tilemap.aseprite differ diff --git a/res/tilemap.js b/res/tilemap.js index 11a3012..e9ab177 100644 --- a/res/tilemap.js +++ b/res/tilemap.js @@ -49,6 +49,10 @@ * 44. Stamina filled * 45. Stamina empty * 46. Fireball + * 47. Door_s + * 48. Corner bottom -> left after 16 + * 49. Corner right -> bottom before 12 + * 50. bottom piece underneath 47 ------------------------------------------------------------------- */ module.exports = [ { @@ -286,4 +290,24 @@ module.exports = [ y: 288, walkable: false }, + { + x: 64, + y: 288, + walkable: true + }, + { + x: 96, + y: 288, + walkable: false + }, + { + x: 128, + y: 288, + walkable: false + }, + { + x: 0, + y: 320, + walkable: false + }, ]; \ No newline at end of file diff --git a/res/tilemap.png b/res/tilemap.png index 532aeb8..6ceef37 100644 Binary files a/res/tilemap.png and b/res/tilemap.png differ diff --git a/src/levels/1-1 copy.js b/src/levels/1-1 copy.js deleted file mode 100644 index 4d6fafe..0000000 --- a/src/levels/1-1 copy.js +++ /dev/null @@ -1,57 +0,0 @@ -const tileSize = 32; - -let level = { - tiles: [ - 1, 2, 2, 2, 2, 6, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 6, - 4, 21, 22, 23, 21, 7, 0, 4, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 7, - 4, 17, 17, 17, 17, 7, 0, 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 7, 0, 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 8, 2, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 22, 22, 22, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 14, 15, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 9 - ], - size: { - w: 960, - h: 480 - }, - startPos: [ - { x: 48, y: 64 }, - { x: 48, y: 128 } - ], - entities: [ - { - type: "Mage", - pos: { x: 12 * tileSize, y: 2 * tileSize } - }, - { - type: "Mage", - pos: { x: 1 * tileSize, y: 8 * tileSize } - }, - { - type: "Chest", - pos: { x: 4 * tileSize, y: 2 * tileSize }, - action: (player) => { - player.items.keys.push("1-2_3"); - } - }, - { - type: "Portal", - pos: { x: 8 * tileSize, y: 2 * tileSize }, - texture: "Ladder", - action: (_player, level) => { - level.switch = { module: "./src/levels/1-1.js", pos: 0 }; - }, - key: "1-2_3" - } - ] -}; - -module.exports = level; \ No newline at end of file diff --git a/src/levels/1-1.js b/src/levels/1-1.js index ed935ba..f5e49c8 100644 --- a/src/levels/1-1.js +++ b/src/levels/1-1.js @@ -2,52 +2,35 @@ const tileSize = 32; let level = { tiles: [ - 1, 2, 2, 2, 2, 6, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 6, - 4, 21, 22, 23, 21, 7, 0, 4, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 7, - 4, 17, 17, 17, 17, 7, 0, 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 7, 0, 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 8, 2, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 22, 22, 22, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, - 14, 15, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 9 + 1, 2, 2, 5, 6, + 4, 21, 22, 23, 7, + 4, 17, 17, 17, 7, + 4, 17, 17, 17, 7, + 4, 17, 17, 17, 7, + 14, 16, 18, 12, 13, + 0, 14, 50, 13, 0, ], size: { - w: 960, - h: 480 + w: 5 * tileSize, + h: 7 * tileSize }, startPos: [ - { x: 48, y: 64 }, - { x: 48, y: 128 } + { x: 56, y: 64 } ], entities: [ - { - type: "Mage", - pos: { x: 12 * tileSize, y: 2 * tileSize } - }, - { - type: "Mage", - pos: { x: 1 * tileSize, y: 8 * tileSize } - }, { type: "Chest", - pos: { x: 4 * tileSize, y: 2 * tileSize }, + pos: { x: 2 * tileSize, y: 2 * tileSize }, action: (player) => { player.items.keys.push("1-1_1"); } }, { type: "Portal", - pos: { x: 8 * tileSize, y: 2 * tileSize }, - texture: "Ladder", + pos: { x: 2 * tileSize, y: 5 * tileSize }, + texture: "Door_s", action: (_player, level) => { - level.switch = { module: "./src/levels/1-1 copy.js", pos: 0 }; + level.switch = { module: __dirname + "/1-2.js", pos: 0 }; }, key: "1-1_1" } diff --git a/src/levels/1-2.js b/src/levels/1-2.js new file mode 100644 index 0000000..34c5b01 --- /dev/null +++ b/src/levels/1-2.js @@ -0,0 +1,48 @@ +const tileSize = 32; + +let level = { + tiles: [ + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 6, + 4, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 22, 23, 21, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 4, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 7, + 14, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 13 + ], + size: { + w: 30 * tileSize, + h: 10 * tileSize + }, + startPos: [ + { x: 5 * tileSize, y: 3 * tileSize }, + { x: 48, y: 128 } + ], + entities: [ + { + type: "Mage", + pos: { x: 1 * tileSize, y: 8 * tileSize } + }, + { + type: "Chest", + pos: { x: 4 * tileSize, y: 2 * tileSize }, + action: (player) => { + player.items.keys.push("1-1_1"); + } + }, + { + type: "Portal", + pos: { x: 5 * tileSize, y: 1 * tileSize }, + texture: "Door_n", + action: (_player, level) => { + level.switch = { module: "./src/levels/1-1.js", pos: 0 }; + }, + key: "1-1_1" + } + ] +}; + +module.exports = level; \ No newline at end of file