User prompt
add a delay of 2 seconds after the last enemy appears in room5()
Code edit (1 edits merged)
Please save this source code
User prompt
add that to the update function
User prompt
in room5, instantiate arrowright at room5state.arrowrightx and room5state.arrowrighty and .down action is to call exitroom5 and play the s_footstep sound
Code edit (3 edits merged)
Please save this source code
User prompt
on push down of the krampus halfA, destroy krampushalfA, add to inventory bg_krampushalfA, set room5state.is_key_found to true
User prompt
once the spawning of enemy is done, instantiate krampushalfA at room5state keyX and room5state.keyY
Code edit (1 edits merged)
Please save this source code
User prompt
once you enter the room5() spawn between 10 and 15 enemies at random interval for 6 second
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: levelObjs is not defined' in or related to this line: 'levelObjs.push(bathRoomKey);' Line Number: 1458
User prompt
Please fix the bug: 'Uncaught ReferenceError: levelObjs is not defined' in or related to this line: 'levelObjs.push(bathroomLock);' Line Number: 1437
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: levelObjs is not defined' in or related to this line: 'levelObjs.push(elfEnvelope);' Line Number: 1361
User prompt
Please fix the bug: 'ReferenceError: levelObjs is not defined' in or related to this line: 'console.log(levelObjs);' Line Number: 2082
User prompt
do it
User prompt
ensure the function destroyObjects destroys the objects as well as free up the array
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: is_level3 is not defined' in or related to this line: 'if (is_level3) {' Line Number: 2166
Code edit (1 edits merged)
Please save this source code
User prompt
in room4() if room4state.is_dollkey_found == false, instantiate the dollkey at dollkeyx and dollkeyy
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'destroy')' in or related to this line: 'krampusHalfB.destroy();' Line Number: 2282
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of null (reading 'destroy')' in or related to this line: 'krampusHalfB.destroy();' Line Number: 2282
User prompt
Please fix the bug: 'Uncaught TypeError: krampusHalfB.destroy is not a function' in or related to this line: 'krampusHalfB.destroy();' Line Number: 2282
===================================================================
--- original.js
+++ change.js
@@ -254,9 +254,9 @@
var inventoryCoordinateRightX = 2048 / 2 - 280; //+ 500;
var collidableObjects = {};
var menuObjects = [];
var howToObjects = [];
-var levelObjsMap = {};
+var levelObjs = [];
var inventoryUI1;
var inventoryUI2;
//elements of the narration screen so that we can easily destroy or add them to the game
var introObjects = [];
@@ -870,13 +870,13 @@
anchorY: 0.5,
x: 2048 / 2 + 835,
y: 2732 / 2 - 260
}));
- levelObjsMap['darkNumber'] = darkNumber;
- levelObjsMap['darkNumber28'] = darkNumber28;
- levelObjsMap['darkNumber7'] = darkNumber7;
- levelObjsMap['darkNumber0'] = darkNumber0;
- levelObjsMap['titleScreen'] = titleScreen;
+ menuObjects.push(darkNumber);
+ menuObjects.push(darkNumber28);
+ menuObjects.push(darkNumber7);
+ menuObjects.push(darkNumber0);
+ menuObjects.push(titleScreen);
// Play s_splashscreen when the game starts
LK.setTimeout(function () {
LK.playMusic('s_SplashScreen', {
loop: true
@@ -888,26 +888,26 @@
anchorY: 1.0,
x: 2048 / 2,
y: 2832
}));
- levelObjsMap['tornRope'] = tornRope;
+ menuObjects.push(tornRope);
// Retrieve the 'bg_eyeflash' asset, position it at the center of the playspace and set its alpha to 50%
eyeFlash = game.addChild(LK.getAsset('bg_eyeflash', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 75,
y: 2732 / 2 - 100,
alpha: 0.20
}));
- levelObjsMap['eyeFlash'] = eyeFlash;
+ menuObjects.push(eyeFlash);
// Retrieve the 'bg_StartButton' asset and position it at the bottom left of the playspace
var startButton = game.addChild(LK.getAsset('bg_StartButton', {
anchorX: 0.0,
anchorY: 1.0,
x: 150,
y: 2732
}));
- levelObjsMap['startButton'] = startButton;
+ menuObjects.push(startButton);
// Add a down event to the startButton
startButton.down = function (x, y, obj) {
// Disable how-to button
howTo.down = null;
@@ -928,9 +928,9 @@
anchorY: 1.0,
x: 1950,
y: 2732
}));
- levelObjsMap['howTo'] = howTo;
+ menuObjects.push(howTo);
// Variable to track the state of bg_HelpMenu
is_helpMenuVisible = false;
var helpMenu;
// Add a down event to the howTo button
@@ -964,9 +964,8 @@
}
}
// Stop all sounds
LK.stopMusic();
- destroyObjects(levelObjsMap);
}
//function to destroy the objects that are created once the how to menu is opened.
function exitHowTo() {
for (var i = howToObjects.length - 1; i >= 0; i--) {
@@ -983,25 +982,25 @@
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2 + 150
}));
- levelObjsMap['helpMenu'] = helpMenu;
+ howToObjects.push(helpMenu);
is_helpMenuVisible = true;
// Include bg_ClownKey, bg_HelpIcon01, and bg_InventoryUI
var clownKey = game.addChild(LK.getAsset('bg_ClownKey', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 375,
y: 2732 / 2 + 625
}));
- levelObjsMap['clownKey'] = clownKey;
+ howToObjects.push(clownKey);
var helpAnim = game.addChild(LK.getAsset('bg_HelpAnim', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 550,
y: 2732 / 2 + 800
}));
- levelObjsMap['helpAnim'] = helpAnim;
+ howToObjects.push(helpAnim);
// Animate clownKey and helpAnim
function animateClownKeyAndHelpAnim() {
tween(clownKey, {
x: clownKey.x - 400,
@@ -1046,9 +1045,9 @@
});
naughtyText.anchor.set(0.5, 0);
naughtyText.x = 2048 / 2 + 250;
naughtyText.y = 100 + 1175;
- levelObjsMap['naughtyText'] = naughtyText;
+ howToObjects.push(naughtyText);
game.addChild(naughtyText);
// Instantiate bg_HelpAnim asset on the top left of the naughtyText
var helpAnimTopLeft = LK.getAsset('bg_HelpAnim', {
anchorX: 0.5,
@@ -1057,9 +1056,9 @@
// Position to the left of naughtyText
y: naughtyText.y // Position above naughtyText
});
game.addChild(helpAnimTopLeft);
- levelObjsMap['helpAnimTopLeft'] = helpAnimTopLeft;
+ howToObjects.push(helpAnimTopLeft);
var inventoryUI = LK.getAsset('bg_InventoryUI', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 375,
@@ -1071,9 +1070,9 @@
game.setChildIndex(helpAnim, game.children.length - 1);
// Ensure bg_Grain and bg_ScanLines are always on the top layer
game.setChildIndex(scanLines, game.children.length - 1);
game.setChildIndex(grain, game.children.length - 1);
- levelObjsMap['inventoryUI'] = inventoryUI;
+ howToObjects.push(inventoryUI);
return helpMenu;
}
//function to load the intro narrative
function loadIntroNarrative() {
@@ -1132,17 +1131,17 @@
krampusText.anchor.set(0.5, 0);
krampusText.x = 2048 / 2;
krampusText.y = 300;
game.addChild(krampusText);
- levelObjsMap['krampusText'] = krampusText;
+ introObjects.push(krampusText);
// Add a skip button at the bottom right of the screen
var skipButton = game.addChild(LK.getAsset('bg_SkipButton', {
anchorX: 1.0,
anchorY: 1.0,
x: 2048 - 50,
y: 2732 - 50
}));
- levelObjsMap['skipButton'] = skipButton;
+ introObjects.push(skipButton);
// Add a down event to the skipButton
skipButton.down = function (x, y, obj) {
// Stop the parallel process of displayNextText
currentTextIndex = textSequence.length; // Set index to end to stop further text display
@@ -1179,9 +1178,9 @@
});
}
}
displayNextText();
- levelObjsMap['krampus'] = krampus;
+ introObjects.push(krampus);
game.setChildIndex(grain, game.children.length - 1);
game.setChildIndex(scanLines, game.children.length - 1);
}, 2000);
this.laughPlayed = true;
@@ -1202,9 +1201,9 @@
y: 2732 / 2,
alpha: 0
});
game.addChild(room01);
- levelObjsMap['room01'] = room01;
+ levelObjs.push(room01);
tween(room01, {
alpha: 1
}, {
duration: 3000,
@@ -1242,9 +1241,9 @@
y: room1State.elfY,
alpha: 0
});
game.addChild(elfEnvelope);
- levelObjsMap['elfEnvelope'] = elfEnvelope;
+ levelObjs.push(elfEnvelope);
// Add event listener for elf envelope
elfEnvelope.down = function (x, y, obj) {
if (!isHelpIconActive) {
// Instantiate help icon in the center of the playspace
@@ -1317,9 +1316,9 @@
// Add event listener for bathroomLock
bathroomLock.down = function (x, y, obj) {
shakeAsset(bathroomLock);
};
- levelObjsMap['bathroomLock'] = bathroomLock;
+ levelObjs.push(bathroomLock);
var bathRoomKey = LK.getAsset('bg_BathRoomKey', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 325,
@@ -1338,9 +1337,9 @@
// Play s_GetItem sound
LK.getSound('s_GetItem').play();
}
};
- levelObjsMap['bathRoomKey'] = bathRoomKey;
+ levelObjs.push(bathRoomKey);
// Instantiate bg_FakeDoll in the bottom middle of the playspace
fakeDoll = LK.getAsset('bg_FakeDoll', {
anchorX: 0.5,
anchorY: 1.0,
@@ -1408,9 +1407,9 @@
x: 2048 / 2,
y: 2732 / 2
});
game.addChild(room02);
- levelObjsMap['room02'] = room02;
+ levelObjs.push(room02);
var fusebox = LK.getAsset('bg_FuseBox', {
anchorX: 0.5,
anchorY: 0.5,
x: room2State.fuseboxX,
@@ -1601,18 +1600,14 @@
function destroyObjects(objectArray) {
if (!objectArray) {
return;
} // Check if objectArray is undefined
- for (var key in objectArray) {
- if (objectArray.hasOwnProperty(key) && objectArray[key]) {
- objectArray[key].destroy();
+ for (var i = objectArray.length - 1; i >= 0; i--) {
+ if (objectArray[i]) {
+ objectArray[i].destroy();
}
}
- for (var key in objectArray) {
- if (objectArray.hasOwnProperty(key)) {
- delete objectArray[key];
- }
- }
+ objectArray.length = 0; // Clear the array
}
function unlockLock(keyAsset, lockAsset, lockAssetName, arrowAssetName, x, y) {
LK.getSound('s_UnlockSound').play();
lockAsset.destroy();
@@ -1637,9 +1632,9 @@
y: 2732 / 2,
alpha: 0
});
game.addChild(room03);
- levelObjsMap['room03'] = room03;
+ levelObjs.push(room03);
// Fade in bg_Room03
fadeInObj(room03, 3000);
//WE BEGIN TO INSTANTIATE DEPENDING ON THE ROOMSTATE
//krampus lock checks, krampus lock leads to victory end
@@ -1754,9 +1749,9 @@
y: 2732 / 2,
alpha: 0
});
game.addChild(room05);
- levelObjsMap['room05'] = room05;
+ levelObjs.push(room05);
// Fade in bg_Room05
fadeInObj(room05, 3000);
//ONCE WE ARE DONE INSTANTIATING, BRING FORTH THE CLOCK, INVENTORY AND VCR EFFECT.
bringForwardInventory();
@@ -1777,9 +1772,9 @@
y: 2732 / 2,
alpha: 0
});
game.addChild(room06);
- levelObjsMap['room06'] = room06;
+ levelObjs.push(room06);
// Fade in bg_Room05
fadeInObj(room06, 3000);
//ONCE WE ARE DONE INSTANTIATING, BRING FORTH THE CLOCK, INVENTORY AND VCR EFFECT.
bringForwardInventory();
@@ -1800,9 +1795,9 @@
y: 2732 / 2,
alpha: 0
});
game.addChild(room4);
- levelObjsMap['room4'] = room4;
+ levelObjs.push(room4);
// Fade in room4
fadeInObj(room4, 3000);
var arrowLeft = LK.getAsset('bg_ArrowLeft', {
anchorX: 0.5,
@@ -1963,9 +1958,9 @@
//the update function and the game flow
//----------------------------------------------------------------------------------------------------
//the game update function that looks at the state of the game.
game.update = function () {
- console.log(levelObjsMap);
+ console.log(levelObjs);
// Create a new snowflake every 90 ticks only if the main menu is on
if (is_mainMenu) {
// Play either s_manscream01, s_manscream02, s_womanscream01, s_womanscream02 every 10 to 20 seconds
if (timeElapsed % (Math.floor(Math.random() * (1200 - 600 + 1)) + 600) == 0) {
@@ -2215,8 +2210,9 @@
//at any point in the game, check for the krampus halfA and krampushalfB and validate if the
//player is trying to combine the keys.
var krampusHalfA = {};
var krampusHalfB = {};
+ console.log(collidableObjects);
};
//the game flow starts here
loadMenu();
// Call the vcr function to initialize bg_Grain and bg_ScanLine
Eerie Christmas-inspired toy shop The only text on screen should be the title "Krampus Lockdown" centered on the image.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a single cartoon snowflake. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple eerie christmas blank dirty ripped paper. Use christmas colors. Do not put text, just the dirty ripped paper so i can fill it myself with text. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. No text.
A heavily grainy screen filled with analog noise, washed-out colors, subtle scratches on the film, and a worn, nostalgic texture.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
horizontal scan lines, slightly distorted colors, subtle static noise, and faint glow around edges.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bloody christmas elf glove tapping at screen clipart. Just the glove. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the number 13 written in black. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
black gothic frame with a question mark inside silhouette. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple dirty, dark and eerie Christmas clown key. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the number 28 written in black, make the numbers eerie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the number 7 written in black, make the numbers eerie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
the number 0 written in black, make the numbers eerie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired room similar to a resident evil room Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired bathroom similar to a resident evil room Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a cartoon envelope with an toy elf on it holding a questionmark. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple dirty, dark and eerie Christmas bathroom key. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired krampus lock with a resident evil style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired button as an arrow pointing right that says SKIP in a creepy font png. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired garage similar to a resident evil room Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple fuse inspired from a resident evil puzzle graphics Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
an eerie wall fusebox Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired hallway similar to a resident evil room Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie creepy old rusty key with krampus face embossed on it png. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple dirty, dark and eerie Christmas bathroom key. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired mistletoe lock with a resident evil style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired tree lock with a resident evil style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple dirty, dark and eerie Christmas light key. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired christmas light lock with a resident evil style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
eerie christmas inspired lump of coal with a resident evil style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie flame similar to a resident evil asset, realistic Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired krampus statuette similar to a resident evil asset Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple eerie christmas blank dirty letter envelope. Use christmas colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. No text.
Eerie Christmas-inspired crypt room similar to a resident evil room Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a simple dark red cartoon christmas hat Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. No text.
cartoon mulled wine. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
cartoon christmas inspired question mark Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
krampus with a christmas hat coin embossed on it png. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
mulled wine coin embossed on it png. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Eerie Christmas-inspired krampus doll sitting similar to a resident evil Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
old safe png grey with four buttons on the side. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
s_KrampusLaugh01
Sound effect
s_SplashScreen
Sound effect
s_KrampusLaugh02
Sound effect
s_WomanScream01
Sound effect
s_ManScream01
Sound effect
s_ManScream02
Sound effect
s_WomanScream02
Sound effect
s_LightBuzz
Sound effect
s_ShutdownSound
Sound effect
s_CrumpledPaper
Sound effect
s_Bathroom
Sound effect
s_GameOver
Sound effect
s_CartoonRun
Sound effect
s_GetItem
Sound effect
s_KrampusScream
Sound effect
s_UnlockSound
Sound effect
s_WindBlow
Sound effect
s_FuseBoxOn
Sound effect
s_GeneratorSound
Sound effect
s_Locked
Sound effect
s_Interior
Sound effect
s_DollDeath
Sound effect
s_Footsteps
Sound effect
s_DollLaugh01
Sound effect
s_DollLaugh02
Sound effect
s_DollDeath01
Sound effect
s_DollDeath02
Sound effect
s_EncounterMusic
Sound effect
s_FirstDollMusic
Sound effect
s_ChristmasMusic
Sound effect
s_BreakingSound
Sound effect
s_Collected
Sound effect
s_Extinguished
Sound effect
s_Appear
Sound effect
s_MulledWine
Sound effect
s_Slurping
Sound effect
s_SafeUnlocked
Sound effect
s_LockedSafe
Sound effect