diff --git a/Overworld.js b/Overworld.js index 2f455bb..b0d8a80 100644 --- a/Overworld.js +++ b/Overworld.js @@ -71,12 +71,13 @@ class Overworld { this.startGameLoop(); this.map.startCutscene([ - { who: "hero", type: "walk", direction: "down" }, - { who: "hero", type: "walk", direction: "down" }, - { who: "hero", type: "walk", direction: "down" }, - { who: "npc1", type: "walk", direction: "right" }, - { who: "hero", type: "stand", direction: "left", time: 200 }, - { type: "textMessage", text: "Hi! Lorem ipsum" }, + // { who: "hero", type: "walk", direction: "down" }, + // { who: "hero", type: "walk", direction: "down" }, + // { who: "hero", type: "walk", direction: "down" }, + // { who: "npc1", type: "walk", direction: "right" }, + // { who: "hero", type: "stand", direction: "left", time: 200 }, + // { type: "textMessage", text: "Hi! Lorem ipsum" }, + // { type: "changeMap", map: "Kitchen" }, ]) } } \ No newline at end of file diff --git a/OverworldMap.js b/OverworldMap.js index 8d185af..042031d 100644 --- a/OverworldMap.js +++ b/OverworldMap.js @@ -210,6 +210,34 @@ window.OverworldMaps = { ] } ], + [utils.asGridCoord(11,11)]: [ + { + events: [ + { type: "changeMap", map: "Bedroom" } + ] + } + ], + [utils.asGridCoord(8,13)]: [ + { + events: [ + { type: "changeMap", map: "Bathroom" } + ] + } + ], + [utils.asGridCoord(5,11)]: [ + { + events: [ + { type: "changeMap", map: "Livingroom" } + ] + } + ], + [utils.asGridCoord(1,6)]: [ + { + events: [ + { type: "changeMap", map: "Office" } + ] + } + ], } }, Kitchen: { @@ -270,5 +298,201 @@ window.OverworldMaps = { } ], } - } + }, + Bedroom: { + lowerSrc: "/images/maps/map-room-bedroom.png", + // upperSrc: "/images/maps/room-builder.png", + upperSrc: "", + gameObjects: { + hero: new Person({ + isPlayerControlled: true, + x: utils.withGrid(1), + y: utils.withGrid(4), + }), + }, + walls: { + // "16,16": true + [utils.asGridCoord(1,2)] : true, + [utils.asGridCoord(1,3)] : true, + [utils.asGridCoord(0,4)] : true, + [utils.asGridCoord(1,5)] : true, + [utils.asGridCoord(1,6)] : true, + [utils.asGridCoord(1,7)] : true, + [utils.asGridCoord(1,8)] : true, + [utils.asGridCoord(2,9)] : true, + [utils.asGridCoord(3,9)] : true, + [utils.asGridCoord(4,9)] : true, + [utils.asGridCoord(5,9)] : true, + [utils.asGridCoord(6,9)] : true, + [utils.asGridCoord(7,9)] : true, + [utils.asGridCoord(8,8)] : true, + [utils.asGridCoord(8,7)] : true, + [utils.asGridCoord(8,6)] : true, + [utils.asGridCoord(8,5)] : true, + [utils.asGridCoord(8,4)] : true, + [utils.asGridCoord(8,3)] : true, + [utils.asGridCoord(8,2)] : true, + [utils.asGridCoord(7,1)] : true, + [utils.asGridCoord(6,1)] : true, + [utils.asGridCoord(5,1)] : true, + [utils.asGridCoord(4,1)] : true, + [utils.asGridCoord(3,1)] : true, + [utils.asGridCoord(2,1)] : true, + }, + cutsceneSpaces: { + [utils.asGridCoord(1,4)]: [ + { + events: [ + { type: "changeMap", map: "DemoRoom" } + ] + } + ], + } + }, + Bathroom: { + lowerSrc: "/images/maps/map-room-bathroom.png", + // upperSrc: "/images/maps/room-builder.png", + upperSrc: "", + gameObjects: { + hero: new Person({ + isPlayerControlled: true, + x: utils.withGrid(3), + y: utils.withGrid(1), + }), + }, + walls: { + // "16,16": true + [utils.asGridCoord(0,2)] : true, + [utils.asGridCoord(0,3)] : true, + [utils.asGridCoord(0,4)] : true, + [utils.asGridCoord(0,5)] : true, + [utils.asGridCoord(0,6)] : true, + [utils.asGridCoord(1,7)] : true, + [utils.asGridCoord(2,7)] : true, + [utils.asGridCoord(3,7)] : true, + [utils.asGridCoord(4,7)] : true, + [utils.asGridCoord(5,6)] : true, + [utils.asGridCoord(5,5)] : true, + [utils.asGridCoord(5,4)] : true, + [utils.asGridCoord(5,3)] : true, + [utils.asGridCoord(5,2)] : true, + [utils.asGridCoord(4,1)] : true, + [utils.asGridCoord(3,0)] : true, + [utils.asGridCoord(2,1)] : true, + [utils.asGridCoord(1,1)] : true, + }, + cutsceneSpaces: { + [utils.asGridCoord(3,1)]: [ + { + events: [ + { type: "changeMap", map: "DemoRoom" } + ] + } + ], + } + }, + Livingroom: { + lowerSrc: "/images/maps/map-room-livingroom.png", + // upperSrc: "/images/maps/room-builder.png", + upperSrc: "", + gameObjects: { + hero: new Person({ + isPlayerControlled: true, + x: utils.withGrid(11), + y: utils.withGrid(4), + }), + }, + walls: { + // "16,16": true + [utils.asGridCoord(0,2)] : true, + [utils.asGridCoord(0,3)] : true, + [utils.asGridCoord(0,4)] : true, + [utils.asGridCoord(0,5)] : true, + [utils.asGridCoord(0,6)] : true, + [utils.asGridCoord(0,7)] : true, + [utils.asGridCoord(1,8)] : true, + [utils.asGridCoord(2,8)] : true, + [utils.asGridCoord(3,8)] : true, + [utils.asGridCoord(4,8)] : true, + [utils.asGridCoord(5,8)] : true, + [utils.asGridCoord(6,8)] : true, + [utils.asGridCoord(7,8)] : true, + [utils.asGridCoord(8,8)] : true, + [utils.asGridCoord(9,8)] : true, + [utils.asGridCoord(10,8)] : true, + [utils.asGridCoord(11,7)] : true, + [utils.asGridCoord(11,6)] : true, + [utils.asGridCoord(11,5)] : true, + [utils.asGridCoord(12,4)] : true, + [utils.asGridCoord(11,3)] : true, + [utils.asGridCoord(11,2)] : true, + [utils.asGridCoord(10,1)] : true, + [utils.asGridCoord(9,1)] : true, + [utils.asGridCoord(8,1)] : true, + [utils.asGridCoord(7,1)] : true, + [utils.asGridCoord(6,1)] : true, + [utils.asGridCoord(5,1)] : true, + [utils.asGridCoord(4,1)] : true, + [utils.asGridCoord(3,1)] : true, + [utils.asGridCoord(2,1)] : true, + [utils.asGridCoord(1,1)] : true, + }, + cutsceneSpaces: { + [utils.asGridCoord(11,4)]: [ + { + events: [ + { type: "changeMap", map: "DemoRoom" } + ] + } + ], + } + }, + Office: { + lowerSrc: "/images/maps/map-room-office.png", + // upperSrc: "/images/maps/room-builder.png", + upperSrc: "", + gameObjects: { + hero: new Person({ + isPlayerControlled: true, + x: utils.withGrid(8), + y: utils.withGrid(4), + }), + }, + walls: { + // "16,16": true + [utils.asGridCoord(0,2)] : true, + [utils.asGridCoord(0,3)] : true, + [utils.asGridCoord(0,4)] : true, + [utils.asGridCoord(0,5)] : true, + [utils.asGridCoord(0,6)] : true, + [utils.asGridCoord(1,7)] : true, + [utils.asGridCoord(2,7)] : true, + [utils.asGridCoord(3,7)] : true, + [utils.asGridCoord(4,7)] : true, + [utils.asGridCoord(5,7)] : true, + [utils.asGridCoord(6,7)] : true, + [utils.asGridCoord(7,7)] : true, + [utils.asGridCoord(8,6)] : true, + [utils.asGridCoord(8,5)] : true, + [utils.asGridCoord(9,4)] : true, + [utils.asGridCoord(8,3)] : true, + [utils.asGridCoord(8,2)] : true, + [utils.asGridCoord(7,1)] : true, + [utils.asGridCoord(6,1)] : true, + [utils.asGridCoord(5,1)] : true, + [utils.asGridCoord(4,1)] : true, + [utils.asGridCoord(3,1)] : true, + [utils.asGridCoord(2,1)] : true, + [utils.asGridCoord(1,1)] : true, + }, + cutsceneSpaces: { + [utils.asGridCoord(8,4)]: [ + { + events: [ + { type: "changeMap", map: "DemoRoom" } + ] + } + ], + } + }, } \ No newline at end of file diff --git a/images/maps/map-room-bathroom.png b/images/maps/map-room-bathroom.png new file mode 100644 index 0000000..ba728ce Binary files /dev/null and b/images/maps/map-room-bathroom.png differ diff --git a/images/maps/map-room-bedroom.png b/images/maps/map-room-bedroom.png new file mode 100644 index 0000000..6a3918a Binary files /dev/null and b/images/maps/map-room-bedroom.png differ diff --git a/images/maps/map-room-livingroom.png b/images/maps/map-room-livingroom.png new file mode 100644 index 0000000..5375ee8 Binary files /dev/null and b/images/maps/map-room-livingroom.png differ diff --git a/images/maps/map-room-office.png b/images/maps/map-room-office.png new file mode 100644 index 0000000..f7b9acf Binary files /dev/null and b/images/maps/map-room-office.png differ