Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: clearInterval is not a function' in or related to this line: 'clearInterval(movementCheckInterval);' Line Number: 164
User prompt
Please fix the bug: 'Uncaught TypeError: setInterval is not a function' in or related to this line: 'movementCheckInterval = setInterval(function () {' Line Number: 142
Code edit (1 edits merged)
Please save this source code
User prompt
do it
User prompt
if the user stops moving the asset after starting to drag it away from the inventory but is still touching the screen, update the position of the asset to the position of the user's finguer
User prompt
if the user stops moving the asset but is still touching the screen, update the position of the asset to the position of the user's finguer
Code edit (3 edits merged)
Please save this source code
User prompt
prevent lagging on the x axis when dragging the asset
User prompt
in the level1, add a listener to Check collision between bathroomKeyItem and bathroomLock, instantiate bathroomArrow, and free inventory space
User prompt
when bathroomkeyitem collides with bathroomlock, free the space in the inventory and at the location of the bathroomlock, instantiate the bathroom arrow
User prompt
create a function to remove an asset from the inventory. it should destroy the asset from the game and it should make the space available in the inventory array again
User prompt
ensure that the dragging of the inventory object follows the same speed as the mouse or finger on the screen
User prompt
when the inventory asset has stopped being in movement from the dragging, bring it back to its original coordinate
User prompt
when the skip button is pressed, stopped the parrallel process of the displaynext() function
User prompt
Please fix the bug: 'Uncaught ReferenceError: dragNode is not defined' in or related to this line: 'if (dragNode === asset) {' Line Number: 128
User prompt
when bathroomkey is tapped, destroy it and add to the inventory the bathroomkeyitem
User prompt
how do you enable an item to be dragged across the screen in the game
User prompt
create a function that will add an item to the inventory. it should take in as an argument the name of the asset to instantiate. it should check for the first empty inventoryindex, then if the value is not -1 look for the location by using the inventorycoordinate function. if the value is left, instantiate the asset at the inventorycoordinateleft x and inventorycoordy, if the value is right, instantiate the asset at inventorycoordinaterightx and inventorycoordy
User prompt
create a function called inventoryCoordinate that depending on the index argument passed it will return the value "left" if the index is 0, "right" if the index is 1 and -1 if the index is anything else than that.
User prompt
create a function that will check for collision between 2 game objects
User prompt
create a function that will go through the inventory array and look for the first empty index and return the index
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(elfEnvelope, {' Line Number: 720
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'tween(bathRoomKey, {' Line Number: 706
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
// Create a Snowflake class by using the LK expand method to extend Container.
var Snowflake = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'bg_Snowflake' with the anchor point set to .5, .5
var scale = Math.random() * 0.5 + 0.5; // Random scale between 0.5 and 1
var snowflakeGraphics = self.attachAsset('bg_Snowflake', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: scale,
scaleY: scale
});
// Set snowflake speed
self.speed = Math.random() * 0.5 + 0.5;
// This is automatically called every game tick, if the snowflake is attached!
self.update = function () {
self.y += self.speed;
// If the snowflake is off the screen, destroy it
if (self.y > 2732 || self.x < 0) {
self.destroy();
}
};
});
/****
* Initialize Game
****/
//---------------------------------------------------------------------------------------------------
//create variables for the various assets that will be loaded and unloaded and their various types
//---------------------------------------------------------------------------------------------------
//array for the elements of the menu so that we can easily destroy them or add them to the game
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
var clockInterval = null;
function startClock() {
if (!clockInterval) {
clockInterval = LK.setInterval(function () {
clock.seconds++;
if (clock.seconds >= 60) {
clock.seconds = 0;
clock.minutes++;
if (clock.minutes >= 60) {
clock.minutes = 0;
clock.hours++;
if (clock.hours >= 24) {
clock.hours = 0;
}
}
}
}, 1000);
}
}
function pauseClock() {
if (clockInterval) {
LK.clearInterval(clockInterval);
clockInterval = null;
}
}
//---------------------------------------------------------------------------------------------------
//create variables for the various assets that will be loaded and unloaded and their various types
//---------------------------------------------------------------------------------------------------
//array for the elements of the menu so that we can easily destroy them or add them to the game
var inventory = new Array(2).fill(null); // Inventory array of length 2
var inventoryCoordinateLeftX = 2048 / 2 - 780; //2048 / 2 - 500;
var inventoryCoordY = 2732 - 250;
var inventoryCoordinateRightX = 2048 / 2 - 280; //+ 500;
// Tween import
var menuObjects = [];
var howToObjects = [];
//elements of the narration screen so that we can easily destroy or add them to the game
var introObjects = [];
//array for the snowflakes
var snowflakes = [];
//variables for the vcr effect that will hold the various assets of the effect
var grain, scanLines;
// Create a variable to keep track of the flicker state
var is_flickerState = false;
// Define eyeFlash variable
var eyeFlash;
//variable to keep track of if we are in the mainMenu or not
var is_mainMenu = false;
//variable to keep track of the help menu
var is_helpMenuVisible = false;
// Create a variable to keep track of the time elapsed
var timeElapsed = 0;
// Create a clock variable to store the initial time of 11 hours and 45 minutes
var clock = {
hours: 11,
minutes: 55,
seconds: 0
};
//------------------------------------------------------------------------------------
//functions for the visual and sound effects
//------------------------------------------------------------------------------------
//function that adds the effect of a vcr screen to the game.
function vcr() {
// Add bg_Grain in the center of the playspace and set its alpha to 20%
grain = game.addChild(LK.getAsset('bg_Grain', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2,
alpha: 0.15
}));
// Instantiate bg_ScanLines in the center of the playspace above bg_grain
scanLines = game.addChild(LK.getAsset('bg_ScanLine', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2,
alpha: 0.12
}));
// Ensure bg_Grain and bg_ScanLines are always on the top layer
game.setChildIndex(grain, game.children.length - 1);
game.setChildIndex(scanLines, game.children.length - 1);
// Function to animate bg_ScanLines
function animateScanLines() {
// Randomly move up or down by a small amount
var jumpHeight = Math.random() * 600 - 300; // Random value between -25 and 25
scanLines.y += jumpHeight;
// Reposition to center after a short delay
LK.setTimeout(function () {
scanLines.x = 2048 / 2;
scanLines.y = 2732 / 2;
}, 1000); // 1 second delay
}
// Set interval to animate bg_ScanLines every few seconds
LK.setInterval(animateScanLines, 3000); // Every 3 seconds
}
//function to add snowflakes on the screen
function createSnowflake() {
var newSnowflake = new Snowflake();
// Ensure the snowflake spawns from the top of the playspace
newSnowflake.x = Math.random() * 2048;
newSnowflake.y = -50;
snowflakes.push(newSnowflake);
game.addChild(newSnowflake);
}
//function to add screams to a scene
function addScream() {
var randomSound = Math.floor(Math.random() * 4);
switch (randomSound) {
case 0:
LK.getSound('s_ManScream01').play();
break;
case 1:
LK.getSound('s_ManScream02').play();
break;
case 2:
LK.getSound('s_WomanScream01').play();
break;
case 3:
LK.getSound('s_WomanScream02').play();
break;
}
}
//a function to make some text shake
function shakeText(textObject, _onFinish) {
tween(textObject, {
x: textObject.x + 10
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(textObject, {
x: textObject.x - 20
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(textObject, {
x: textObject.x + 20
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(textObject, {
x: textObject.x - 20
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(textObject, {
x: textObject.x + 10
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: _onFinish
});
}
});
}
});
}
});
}
});
}
//function for an animation of the krampus bobbing up and down.
function krampusAnimationLaugh(krampus) {
tween(krampus, {
x: krampus.x + 10,
scaleX: 1.2,
scaleY: 0.8
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(krampus, {
x: krampus.x - 20,
scaleX: 0.8,
scaleY: 1.2
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(krampus, {
x: krampus.x + 20,
scaleX: 1.2,
scaleY: 0.8
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(krampus, {
x: krampus.x - 20,
scaleX: 0.8,
scaleY: 1.2
}, {
duration: 100,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(krampus, {
x: krampus.x + 10,
scaleX: 1,
scaleY: 1
}, {
duration: 100,
easing: tween.easeInOut
});
}
});
}
});
}
});
}
});
}
//--------------------------------------------------------------------------------
//functions that will be for the various loading of the game.
//--------------------------------------------------------------------------------
//a function to load the menu screen
function loadMenu() {
is_mainMenu = true;
// Retrieve the 'bg_TitleScreen' asset and position it at the center of the playspace
var titleScreen = game.addChild(LK.getAsset('bg_TitleScreen', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 100,
y: 2732 / 2
}));
// Instantiate bg_DarkNumber in the center of the playspace
var darkNumber = game.addChild(LK.getAsset('bg_DarkNumber', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 700,
y: 2732 / 2 + 250
}));
// Instantiate bg_DarkNumber28 in the center of the playspace
var darkNumber28 = game.addChild(LK.getAsset('bg_DarkNumber28', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 850,
y: 2732 / 2 + 200
}));
// Instantiate bg_DarkNumber7 in the center of the playspace
var darkNumber7 = game.addChild(LK.getAsset('bg_DarkNumber7', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 825,
y: 2732 / 2
}));
// Instantiate bg_DarkNumber0 in the center of the playspace
var darkNumber0 = game.addChild(LK.getAsset('bg_DarkNumber0', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 835,
y: 2732 / 2 - 260
}));
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
});
}, 1000);
// Retrieve the 'bg_TornRope' asset and position it at the bottom middle of the playspace
var tornRope = game.addChild(LK.getAsset('bg_TornRope', {
anchorX: 0.5,
anchorY: 1.0,
x: 2048 / 2,
y: 2832
}));
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
}));
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
}));
menuObjects.push(startButton);
// Add a down event to the startButton
startButton.down = function (x, y, obj) {
// Disable how-to button
howTo.down = null;
// Close the help menu if it's open
if (is_helpMenuVisible) {
exitHowTo();
is_helpMenuVisible = false;
}
loadIntroNarrative();
};
// Retrieve the 'bg_HowTo' asset and position it at the bottom right of the playspace
var howTo = game.addChild(LK.getAsset('bg_HowTo', {
anchorX: 1.0,
anchorY: 1.0,
x: 1950,
y: 2732
}));
menuObjects.push(howTo);
// Variable to track the state of bg_HelpMenu
is_helpMenuVisible = false;
var helpMenu;
// Add a down event to the howTo button
howTo.down = function (x, y, obj) {
if (!is_helpMenuVisible) {
helpMenu = openHowToButton();
} else {
// Destroy bg_HelpMenu
if (is_helpMenuVisible == true) {
exitHowTo();
is_helpMenuVisible = false;
}
}
// Play s_CrumpledPaper sound
LK.getSound('s_CrumpledPaper').play();
};
}
//a function that will remove all objects from memory when leaving the main menu.
function exitMainMenu() {
is_mainMenu = false;
//destroy all mainMenu objects
for (var i = menuObjects.length - 1; i >= 0; i--) {
if (menuObjects[i]) {
menuObjects[i].destroy();
}
}
//destroy all snowflakes
for (var i = snowflakes.length - 1; i >= 0; i--) {
if (snowflakes[i]) {
snowflakes[i].destroy();
}
}
// Stop all sounds
LK.stopMusic();
}
//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--) {
if (howToObjects[i]) {
howToObjects[i].destroy();
}
}
}
//function for the functionnality of the help button
function openHowToButton() {
// Instantiate bg_HelpMenu in the center of the playspace
helpMenu = game.addChild(LK.getAsset('bg_HelpMenu', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2 + 150
}));
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
}));
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
}));
howToObjects.push(helpAnim);
// Animate clownKey and helpAnim
function animateClownKeyAndHelpAnim() {
tween(clownKey, {
x: clownKey.x - 400,
alpha: 0
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Reset position and alpha after 1 second
LK.setTimeout(function () {
clownKey.x = 2048 / 2 - 375;
clownKey.alpha = 1;
}, 1000);
}
});
tween(helpAnim, {
x: helpAnim.x - 400,
alpha: 0
}, {
duration: 1000,
easing: tween.easeOut,
onFinish: function onFinish() {
// Reset position and alpha after 1 second
LK.setTimeout(function () {
helpAnim.x = 2048 / 2 - 550;
helpAnim.y = 2732 / 2 + 800;
helpAnim.alpha = 1;
}, 1000);
}
});
}
// Start the animation loop
animateClownKeyAndHelpAnim();
LK.setInterval(animateClownKeyAndHelpAnim, 3000);
// Create red text at the top center of the screen
var naughtyText = new Text2("Tap screen to interact \n with the scene \n \n \n \n \n \n Drag from inventory to \n scene to use objects", {
size: 75,
fill: 0x000000,
stroke: 0x000000,
strokeThickness: 5,
font: "Garamond"
});
naughtyText.anchor.set(0.5, 0);
naughtyText.x = 2048 / 2 + 250;
naughtyText.y = 100 + 1175;
howToObjects.push(naughtyText);
game.addChildAt(naughtyText, game.children.indexOf(grain) - 1);
// Include bg_ClownKey, bg_HelpIcon01, and bg_InventoryUI
var helpIcon = game.addChild(LK.getAsset('bg_HelpIcon01', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 375,
y: 2732 / 2
}));
howToObjects.push(helpIcon);
var inventoryUI = LK.getAsset('bg_InventoryUI', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 375,
y: 2732 / 2 + 600
});
game.addChildAt(inventoryUI, game.children.indexOf(grain) - 1);
// Ensure clownKey and helpAnim are above inventory UI
game.setChildIndex(clownKey, game.children.length - 1);
game.setChildIndex(helpAnim, game.children.length - 1);
// Ensure bg_Grain and bg_ScanLines are always on the top layer
if (!game.children.includes(grain)) {
game.addChild(grain);
}
game.setChildIndex(grain, game.children.length - 1);
if (!game.children.includes(scanLines)) {
game.addChild(scanLines);
}
game.setChildIndex(scanLines, game.children.length - 1);
howToObjects.push(inventoryUI);
return helpMenu;
}
//function to load the intro narrative
function loadIntroNarrative() {
// Retrieve the 'bg_DarkFilter' asset, position it at the center of the playspace and set its alpha to 0
var darkFilter = game.addChild(LK.getAsset('bg_DarkFilter', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2,
alpha: 0
}));
// 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
}));
introObjects.push(skipButton);
// Add a down event to the skipButton
skipButton.down = function (x, y, obj) {
// Load level1 when the skip button is clicked
destroyIntroObj();
level1();
};
// Gradually fade in bg_darkfilter
var fadeInterval = LK.setInterval(function () {
darkFilter.alpha += 0.01;
if (darkFilter.alpha >= 1) {
LK.clearInterval(fadeInterval);
}
}, 10);
// Move the destruction of all game elements inside the fadeInterval function
LK.setTimeout(function () {
// Play shutdownsound
LK.getSound('s_ShutdownSound').play();
}, 10);
var fadeInterval = LK.setInterval(function () {
darkFilter.alpha += 0.01;
if (darkFilter.alpha >= 1) {
LK.clearInterval(fadeInterval);
// Ensure bg_Grain and bg_ScanLines are always on the top layer
game.setChildIndex(grain, game.children.length - 1);
game.setChildIndex(scanLines, game.children.length - 1);
LK.setTimeout(function () {
darkFilter.destroy();
}, 2000);
// Destroy all game elements including sounds after 1 second
LK.setTimeout(function () {
exitMainMenu();
// Play s_KrampusLaugh01 2 seconds after bg_darkfilter is at 100% alpha only once
if (!this.is_laughPlayed) {
LK.setTimeout(function () {
LK.getSound('s_KrampusLaugh01').play();
// Instantiate bg_Krampus in the center of the playspace
var krampus = game.addChild(LK.getAsset('bg_Krampus', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 3732 / 2 + 700
}));
// Create red text at the top center of the screen
var krampusText = new Text2("", {
size: 200,
fill: 0xFF0000,
stroke: 0x000000,
strokeThickness: 5,
font: "Garamond"
});
krampusText.anchor.set(0.5, 0);
krampusText.x = 2048 / 2;
krampusText.y = 300;
game.addChild(krampusText);
introObjects.push(krampusText);
var textSequence = ["Hello, Krampus here.", "You’ve been marked \n ‘naughty’ this year.", "But there’s hope \n left for you.", "Solve the puzzles \n before the clock \n strikes 12:00", "or face an unforgiving \n holiday spirit.", "GOOD LUCK!"];
var currentTextIndex = 0;
function displayNextText() {
if (currentTextIndex < textSequence.length) {
if (textSequence[currentTextIndex] === "GOOD LUCK!") {
LK.getSound('s_KrampusLaugh02').play();
krampusAnimationLaugh(krampus);
// Fade out Krampus and Krampus text 2 seconds after GOOD LUCK! is displayed
LK.setTimeout(function () {
tween(krampus, {
alpha: 0
}, {
duration: 2000
});
tween(krampusText, {
alpha: 0
}, {
duration: 2000
});
}, 2000);
level1();
}
krampusText.setText(textSequence[currentTextIndex]);
shakeText(krampusText, function () {
currentTextIndex++;
LK.setTimeout(displayNextText, 2000);
});
}
}
displayNextText();
introObjects.push(krampus);
game.setChildIndex(grain, game.children.length - 1);
game.setChildIndex(scanLines, game.children.length - 1);
}, 2000);
this.laughPlayed = true;
}
}, 1000);
}
}, 10);
}
//function to destroy the objects in the introductionscreen
function destroyIntroObj() {
for (var i = introObjects.length - 1; i >= 0; i--) {
if (introObjects[i]) {
introObjects[i].destroy();
}
}
}
//a function to load the first level of the game.
function level1() {
var level1Objs = [];
//fade in bg_Room01
// Variable to track if help icon is active
var isHelpIconActive = false;
var helpIcon = null;
var helpText = null;
//fade in bg_Room01
var room01 = LK.getAsset('bg_Room01', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2,
alpha: 0
});
game.addChild(room01);
level1Objs.push(room01);
// Instantiate bg_BathroomLock in the middle right of the room 01 playspace
var bathroomLock = LK.getAsset('bg_BathroomLock', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 - 150,
// Positioned towards the right side
y: 2732 / 2 + 300
});
game.addChild(bathroomLock);
level1Objs.push(bathroomLock);
// Synchronize fade-in for all three elements
var bathRoomKey = LK.getAsset('bg_BathRoomKey', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 325,
y: 2732 / 2 + 125,
alpha: 0
});
game.addChild(bathRoomKey);
level1Objs.push(bathRoomKey);
tween(bathRoomKey, {
alpha: 1
}, {
duration: 3000
});
tween(elfEnvelope, {
alpha: 1
}, {
duration: 3000,
easing: tween.easeInOut
});
tween(room01, {
alpha: 1
}, {
duration: 3000,
onFinish: function onFinish() {
LK.playMusic('s_Bathroom', {
loop: true
});
}
});
var bathRoomKey = LK.getAsset('bg_BathRoomKey', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 325,
y: 2732 / 2 + 125,
alpha: 0
});
game.addChild(bathRoomKey);
level1Objs.push(bathRoomKey);
// Instantiate bg_ElfEnvelope01 in the center of the playspace
var elfEnvelope = LK.getAsset('bg_ElfEnvelope01', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 525,
y: 2732 / 2 + 550,
alpha: 0
});
game.addChild(elfEnvelope);
level1Objs.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
helpIcon = game.addChildAt(LK.getAsset('bg_HelpIcon01', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2
}), game.children.indexOf(grain) - 1);
// Create red text above the help icon
helpText = new Text2("Tutorial: \n \n To escape the room, \n collect the key and \n use it on the lock. ", {
size: 100,
fill: 0xFF0000,
font: "Garamond",
align: "center" // Ensure text alignment is set
});
helpText.anchor.set(0.5, 1);
helpText.x = 2048 / 2;
helpText.y = 2732 / 2 + 125;
game.addChildAt(helpText, game.children.indexOf(grain) - 1);
// Play crumpled paper sound
LK.getSound('s_CrumpledPaper').play();
// Set help icon as active
isHelpIconActive = true;
}
};
// Add event listener to destroy help icon and help text when screen is tapped
game.down = function (x, y, obj) {
if (isHelpIconActive && helpIcon) {
helpIcon.destroy();
if (helpText) {
helpText.destroy();
}
LK.getSound('s_CrumpledPaper').play();
isHelpIconActive = false;
}
};
// Add inventory UI at the left of the center at the bottom of the screen
var inventoryUI1 = LK.getAsset('bg_InventoryUI', {
anchorX: 0.5,
anchorY: 0.5,
x: inventoryCoordinateLeftX,
// Position to the left of the center
y: inventoryCoordY // Position at the bottom of the screen
});
var inventoryUI2 = LK.getAsset('bg_InventoryUI', {
anchorX: 0.5,
anchorY: 0.5,
x: inventoryCoordinateRightX,
// Position to the left of the center
y: inventoryCoordY // Position at the bottom of the screen
});
game.addChild(inventoryUI1);
game.addChild(inventoryUI2);
level1Objs.push(inventoryUI2);
level1Objs.push(inventoryUI1);
}
function destroyObjects(objectArray) {
for (var i = objectArray.length - 1; i >= 0; i--) {
if (objectArray[i]) {
objectArray[i].destroy();
}
}
}
//----------------------------------------------------------------------------------------------------
//the update function and the game flow
//----------------------------------------------------------------------------------------------------
//the game update function that looks at the state of the game.
game.update = function () {
// Check the current state of the flicker
if (is_flickerState) {
// If the state is true, set the alpha to 0.5
eyeFlash.alpha = 0.20;
} else {
// If the state is false, set the alpha to 0
eyeFlash.alpha = 0;
}
// Flip the state of the flicker
is_flickerState = !is_flickerState;
// Increment the time elapsed every tick
timeElapsed++;
// 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) {
addScream();
}
//have the snowflakes effect
if (LK.ticks % 90 == 0) {
createSnowflake();
}
}
};
//the game flow starts here
loadMenu();
// Call the vcr function to initialize bg_Grain and bg_ScanLine
vcr();
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