diff --git a/public/index.html b/public/index.html index f54e261..1bb5a7c 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ - Abandoned house game + Abandoned House Game diff --git a/src/game/assets/images/flashlight-big.svg b/src/game/assets/images/flashlight-big.svg new file mode 100644 index 0000000..04ab2d1 --- /dev/null +++ b/src/game/assets/images/flashlight-big.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/game/assets/images/index.js b/src/game/assets/images/index.js index a5e6b0b..8537f42 100644 --- a/src/game/assets/images/index.js +++ b/src/game/assets/images/index.js @@ -13,6 +13,7 @@ import hallRightDoorOpen from "./hall-right-door-open.svg?url"; import key from "./key.svg?url"; import backButton from "./back-button.svg?url"; import flashlight from "./flashlight.svg?url"; +import flashlightBig from "./flashlight-big.svg?url"; import digit0 from "./digit0.svg?url"; import digit1 from "./digit1.svg?url"; @@ -41,6 +42,7 @@ export default { key, backButton, flashlight, + flashlightBig, digit0, digit1, diff --git a/src/game/scenes/room-basement/RoomBasementCloset.js b/src/game/scenes/room-basement/RoomBasementCloset.js index 420550d..dde3a58 100644 --- a/src/game/scenes/room-basement/RoomBasementCloset.js +++ b/src/game/scenes/room-basement/RoomBasementCloset.js @@ -1,4 +1,5 @@ import Scene from "../../../game-engine/scenes/Scene"; +import Flashlight from "../../items/Flashlight"; export default class RoomBasementCloset extends Scene { /** @@ -44,6 +45,39 @@ export default class RoomBasementCloset extends Scene { }, }); + scene.createItem({ + id: "flashlight-big", + attributes: { + classes: ["clickable"], + image: "flashlightBig", + }, + coords: { + top: 570, + left: 640, + shape: [ + [20, 0], + [78, 12], + [87, 27], + [276, 44], + [287, 56], + [283, 93], + [270, 100], + [81, 82], + [70, 95], + [10, 96], + [0, 47], + ], + }, + events: { + click: () => { + game.sounds.play("button"); + scene.removeItem("flashlight-big"); + Flashlight.create(game); + game.equipment.addItem("flashlight"); + }, + }, + }); + scene.addBackButton("room-basement"); return game.scenes.add(scene); diff --git a/src/main.js b/src/main.js index 871ecca..6d72518 100644 --- a/src/main.js +++ b/src/main.js @@ -40,10 +40,6 @@ Promise.all([game.sounds.preload(), game.images.preload()]).then(() => { // Set initial scene. game.scenes.show("hall"); - // Adds flashlight to the storage (just to test it). - Flashlight.create(game); - game.equipment.addItem("flashlight"); - // Adjust game size each time screen properties have changed. window.addEventListener("resize", () => game.update()); window.addEventListener("orientationchange", () => game.update());