Code edit (4 edits merged)
Please save this source code
User prompt
change objwraithtext to ligh tblue
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'stringify')' in or related to this line: 'console.log(JSON.stringify(objEpisodeOne));' Line Number: 308
Code edit (1 edits merged)
Please save this source code
User prompt
objleaves visual should sometimes be flipped on the x axis
Code edit (1 edits merged)
Please save this source code
User prompt
add a failsafe to destroy any objleaf on screen if currentlevel = 2
User prompt
destroy any objforestleaf on screen after pressing objforestleave
Code edit (4 edits merged)
Please save this source code
User prompt
make sure objleaf scales vary from 100% to 70% to 50% to 35%
User prompt
make them start instead anywhere in the upper portion of the playspace and fall down slowly until they are destroyed once outside of the playspace
User prompt
not just one leaf, multiple leaves of different sizes
User prompt
if objcurrentlevel = 1, i want to instantiate objLeaf and its behavior is to start somewhere in the right portion of the playspace and 'fall' towards the bottom left portion of the playspace, like a leaf falls from a tree
User prompt
i don't see it, fix it
Code edit (1 edits merged)
Please save this source code
User prompt
i don't see objEpisodeOne, it should appear above objendgamebg make sure it does
User prompt
make sure objepisodeone is visible before triggering the game over
User prompt
after objendgamebg is instantiated, also instantiate objepisodeone in the bottom right of the playspace above objendgamebg
Code edit (2 edits merged)
Please save this source code
User prompt
i don't see it anymore, fix it
User prompt
there should be only one enchantedartifact
Code edit (2 edits merged)
Please save this source code
User prompt
would it be possible to also add objenchantedarticle to the sequence? i want it to appear and dissapear at the same time
User prompt
change wraithtimertext color to flashy blue
/**** * Classes ****/ var PwrUpText = Container.expand(function () { var self = Container.call(this); var text = new Text2('New Friend!', { size: 100, fill: "#ffffff", fontWeight: 'bold', font: 'Impact' }); text.anchor.set(0.5, 0.5); self.addChild(text); var flashInterval = LK.setInterval(function () { text.visible = !text.visible; }, 200); LK.setTimeout(function () { LK.clearInterval(flashInterval); self.destroy(); }, 2000); }); var objBarrierElemental = Container.expand(function () { var self = Container.call(this); var elementalGraphics = self.attachAsset('objBarrierElemental', { anchorX: 0.5, anchorY: 0.5 }); // Set random scale for the leaf var scaleOptions = [1, 0.7, 0.5, 0.35]; var randomScale = scaleOptions[Math.floor(Math.random() * scaleOptions.length)]; self.scale.set(randomScale); self.update = function () { // Add left and right movement self.x += Math.sin(LK.ticks / 20) * 5; // Adjust the speed and distance of the movement if (!objHero) { return; } var angle = -LK.ticks / 60; // Adjust the speed of rotation to be in the opposite direction var radius = 200; // Adjust the distance from the hero self.x = objHero.x + Math.cos(angle) * radius; self.y = objHero.y + Math.sin(angle) * radius; }; self.defenseTimer = LK.setInterval(function () { var newDefense = new objBarrierElementalDefense(); newDefense.x = objHero.x - 85; newDefense.y = objHero.y - 600; // Position above the hero game.addChild(newDefense); // Removed objCryptLeave instantiation }, 6000); }); var objBarrierElementalDefense = Container.expand(function () { var self = Container.call(this); var defenseGraphics = self.attachAsset('objBarrierElementalDefense', { anchorX: 0.5, anchorY: 0.5, alpha: 0.75 }); self.update = function () { self.rotation += 0.1; }; LK.setTimeout(function () { self.destroy(); }, 3000); }); var objBatSpike = Container.expand(function () { var self = Container.call(this); var spikeGraphics = self.attachAsset('objBatSpike', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 9; LK.getSound('objBatAttack01').play(); self.trail = []; self.update = function () { // Create a new trail segment var trailSegment = self.attachAsset('objBatSpike', { anchorX: 0.5, anchorY: 0.5, alpha: 0.2 }); trailSegment.x = self.x; trailSegment.y = self.y; game.addChild(trailSegment); self.trail.push(trailSegment); // Remove old trail segments if (self.trail.length > 10) { var oldSegment = self.trail.shift(); oldSegment.destroy(); } if (!objHero) { return; } var directionX = objHero.x - self.x; var directionY = objHero.y - self.y; var magnitude = Math.sqrt(directionX * directionX + directionY * directionY); self.x += directionX / magnitude * self.speed; self.y += directionY / magnitude * self.speed; self.trail.forEach(function (segment) { if (segment.intersects(objBarrier)) { segment.destroy(); } }); if (self.intersects(objHeroHealthDisplay)) { objHeroHealth -= 1; self.trail.forEach(function (segment) { segment.destroy(); }); self.destroy(); } else if (self.intersects(objBarrier)) { var fadeOutDuration = 1000; // 1 second var fadeOutInterval = 100; // Interval for alpha reduction var fadeOutSteps = fadeOutDuration / fadeOutInterval; var alphaStep = self.alpha / fadeOutSteps; var fadeOutTimer = LK.setInterval(function () { if (self.alpha > 0) { self.alpha -= alphaStep; } else { self.trail.forEach(function (segment) { segment.destroy(); }); self.destroy(); LK.clearInterval(fadeOutTimer); } }, fadeOutInterval); } }; }); var objBone = Container.expand(function () { var self = Container.call(this); var boneGraphics = self.attachAsset('objBones', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.rotationSpeed = 0.1; self.update = function () { if (!objHeroHealthDisplay) { return; } var directionX = objHeroHealthDisplay.x - self.x; var directionY = objHeroHealthDisplay.y - self.y; var magnitude = Math.sqrt(directionX * directionX + directionY * directionY); self.x += directionX / magnitude * self.speed; self.y += directionY / magnitude * self.speed; self.rotation += self.rotationSpeed; if (self.intersects(objBarrier)) { self.destroy(); } else if (self.intersects(objHeroHealthDisplay)) { self.destroy(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }; }); var objBoneLarge = Container.expand(function () { var self = Container.call(this); var boneGraphics = self.attachAsset('objBones', { anchorX: 0.5, anchorY: 0.5, scaleX: 3, scaleY: 3 }); self.speed = 12; self.rotationSpeed = 0.1; self.update = function () { if (!objHeroHealthDisplay) { return; } var directionX = objHeroHealthDisplay.x - self.x; var directionY = objHeroHealthDisplay.y - self.y; var magnitude = Math.sqrt(directionX * directionX + directionY * directionY); self.x += directionX / magnitude * self.speed; self.y += directionY / magnitude * self.speed; self.rotation += self.rotationSpeed; if (self.intersects(objBarrier)) { self.destroy(); } else if (self.intersects(objHeroHealthDisplay)) { self.destroy(); LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }; }); var objBossPhase1 = Container.expand(function () { var self = Container.call(this); var bossGraphics = self.attachAsset('objBossPhase1', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { // Add any specific update logic for objBossPhase1 here }; var enchantedArtifact = LK.getAsset('objEnchantedArtifact', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 110, y: 2732 / 2 + 200 }); game.addChild(enchantedArtifact); LK.setTimeout(function () { self.visible = 0; enchantedArtifact.visible = 0; }, 5000); LK.setTimeout(function () { LK.effects.flashScreen(0xffffff, 3000); }, 5000); LK.setTimeout(function () { if (enchantedArtifact) { enchantedArtifact.destroy(); } var bossPhase2 = new objBossPhase2(); bossPhase2.x = 2048 / 2 + 50; bossPhase2.y = 2732 / 2 - 150; game.addChild(bossPhase2); }, 5000); }); var objBossPhase2 = Container.expand(function () { var self = Container.call(this); var bossGraphics = self.attachAsset('objBossPhase2', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { if (LK.ticks % 300 === 0) { LK.getSound('objBossBattleHeroSound').play(); // 5 seconds after instantiation (assuming 60 ticks per second) var objEndGameBg = LK.getAsset('objEndGameBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objEndGameBg); var objEpisodeOne = LK.getAsset('objEpisodeOne', { anchorX: 1.0, anchorY: 1.0, x: 2048 / 2 + 950, y: 2732 / 2 + 1300 }); game.addChild(objEpisodeOne); objEpisodeOne.visible = true; // Ensure objEpisodeOne is visible LK.showGameOver(); } // Shimmy effect: move slowly from right to left self.x += Math.sin(LK.ticks / 120) * 1; // Adjust the speed and distance of the movement // Stomping effect: move up and down if (LK.ticks % 120 < 60) { // Add delay to the stomping effect self.y += Math.sin(LK.ticks / 8) * 2; // Adjust the speed and distance of the movement } if (objFireball && self.intersects(objFireball)) { LK.effects.flashObject(self, 0xff0000, 1000); // Flash red for 1 second bossHP -= 1; objFireball.dealtDamage = true; console.log("Boss HP: ", bossHP); if (bossHP <= 0) { LK.effects.flashObject(self, 0xff0000, 3000); // Flash red for 3 seconds if bossHP is 0 LK.setTimeout(function () { if (self) { self.destroy(); } }, 3000); } LK.setTimeout(function () { if (objFireball) { objFireball.destroy(); objFireball = null; } }, 150 + Math.random() * 100); objFireElementalBall.dealtDamage = false; objFireball.dealtDamage = false; } if (objFireElementalBall && self.intersects(objFireElementalBall)) { LK.effects.flashObject(self, 0xff0000, 1000); // Flash red for 1 second bossHP -= 1; objFireElementalBall.dealtDamage = true; console.log("Boss HP: ", bossHP); if (bossHP <= 0) { LK.effects.flashObject(self, 0xff0000, 3000); // Flash red for 3 seconds if bossHP is 0 LK.setTimeout(function () { if (self) { self.destroy(); } }, 3000); } LK.setTimeout(function () { if (objFireElementalBall) { objFireElementalBall.destroy(); objFireElementalBall = null; } }, 150 + Math.random() * 100); } }; }); var objFireElemental = Container.expand(function () { var self = Container.call(this); var elementalGraphics = self.attachAsset('objFireElemental', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { if (!objHero) { return; } var angle = LK.ticks / 60; // Adjust the speed of rotation var radius = 200; // Adjust the distance from the hero self.x = objHero.x + Math.cos(angle) * radius; self.y = objHero.y + Math.sin(angle) * radius; }; // Instantiate objFireElementalBall every 5 to 7 seconds self.ballTimer = LK.setInterval(function () { var newBall = new objFireElementalBall(); newBall.x = self.x; newBall.y = self.y; game.addChild(newBall); LK.getSound('objFireballSound').play(); }, 3000 + Math.random() * 3000); }); var objFireElementalBall = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('objFireElementalBall', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y -= 25; // Move objFireElementalBall upwards self.x += (2048 / 2 - self.x) * 0.01; // Move objFireElementalBall slightly to the center of the playspace // Alternate objFireElementalBall's x axis every 0.1 seconds if (LK.ticks % 6 == 0) { self.scale.x *= -1; } // Check for collision with objBat if (self.intersects(objBat) && !self.dealtDamage || self.intersects(objBossPhase2) && !self.dealtDamage) { if (batHP === 1) { // Trigger flash effect on objBat for 3 seconds if it's on its last life LK.effects.flashObject(objBat, 0xff0000, 3000); } else { // Trigger flash effect on objBat for 1.5 seconds LK.effects.flashObject(objBat, 0xff0000, 1500); } // Reduce bat's HP by 1 batHP -= 1; // Mark objFireElementalBall as having dealt damage self.dealtDamage = true; // Destroy objBat after the flash effect duration if (batHP <= 0) { LK.setTimeout(function () { if (objBat) { objBat.destroy(); objBat = null; } }, batHP === 0 ? 3000 : 1500); } // Generate a random delay between 0.15 and 0.25 seconds (150 to 250 milliseconds) var randomDelay = 150 + Math.random() * 100; // Use LK.setTimeout to delay the destruction of the objFireElementalBall LK.setTimeout(function () { if (self) { self.destroy(); } }, randomDelay); } else if (self.intersects(objSnake) && !self.dealtDamage) { snakeHP -= 1; self.dealtDamage = true; // Trigger a red flash effect on objSnake LK.effects.flashObject(objSnake, 0xff0000, 1000); if (snakeHP <= 0) { // Gradually reduce objSnake's alpha over 2 seconds before destroying it var fadeOutDuration = 2000; // 2 seconds var fadeOutInterval = 100; // Interval for alpha reduction var fadeOutSteps = fadeOutDuration / fadeOutInterval; var alphaStep = objSnake.alpha / fadeOutSteps; var fadeOutTimer = LK.setInterval(function () { LK.getSound('objSnakeDeathSound').play(); if (objSnake && objSnake.alpha > 0) { objSnake.alpha -= alphaStep; objSnake.tint = 0xff0000; // Apply red tint during fade out } else { if (objSnake) { objSnake.destroy(); objSnake = null; game.children.forEach(function (child) { if (child instanceof objSnakeSpit) { child.destroy(); } }); // Instantiate objPowerUpChest in the center of the playspace var objPowerUpChest = LK.getAsset('objPowerUpChest', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 25, y: 2732 / 2 + 375 }); game.addChild(objPowerUpChest); objPowerUpChest.down = function (x, y, obj) { objPowerUpChest.destroy(); }; } LK.clearInterval(fadeOutTimer); } }, fadeOutInterval); } // Generate a random delay between 0.15 and 0.25 seconds (150 to 250 milliseconds) var randomDelay = 150 + Math.random() * 100; // Use LK.setTimeout to delay the destruction of the objFireElementalBall LK.setTimeout(function () { if (self) { self.destroy(); } }, randomDelay); } else if (self.intersects(objWraith) && !self.dealtDamage) { wraithHP -= 1; self.dealtDamage = true; LK.effects.flashObject(objWraith, 0xff0000, 1000); // Flash red for 1 second if (wraithHP <= 0) { LK.effects.flashObject(objWraith, 0xff0000, 3000); LK.setTimeout(function () { if (objWraith) { objWraith.destroy(); objWraith = null; // Instantiate objDanger in the center of the playspace var objDanger = LK.getAsset('objDanger', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 50, y: 2732 / 2 - 100 }); game.addChild(objDanger); // Play objWatchOutSound when objDanger is instantiated LK.getSound('objWatchOutSound').play(); // Toggle visibility of objDanger every 0.5 seconds for 2 seconds var toggleVisibilityInterval = LK.setInterval(function () { objDanger.visible = !objDanger.visible; // Add screen shaking effect var shakeIntensity = 10; var originalX = game.x; var originalY = game.y; var shakeInterval = LK.setInterval(function () { game.x = originalX + (Math.random() - 0.5) * shakeIntensity; game.y = originalY + (Math.random() - 0.5) * shakeIntensity; }, 50); LK.setTimeout(function () { LK.clearInterval(shakeInterval); game.x = originalX; game.y = originalY; }, 500); }, 500); LK.setTimeout(function () { LK.clearInterval(toggleVisibilityInterval); objDanger.visible = true; // Ensure objDanger is visible after the effect objDanger.destroy(); // Destroy objDanger after 2 seconds // Instantiate 7 objStalactite instances at different x and y positions outside of the upper portion of the playspace for (var i = 0; i < 7; i++) { var stalactite = new objStalactite(); stalactite.x = Math.random() * 2048; stalactite.y = Math.random() * -500; // Random y position above the playspace game.addChild(stalactite); } // Wait four seconds after objDanger is destroyed and instantiate objCryptLeave in the center of the playspace LK.setTimeout(function () { var objCryptLeave = LK.getAsset('objCryptLeave', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objCryptLeave); objCryptLeave.down = function (x, y, obj) { objCryptLeave.destroy(); // Replace objEvilCryptBg with objEvilLairBg game.removeChild(objEvilCryptBg); var objEvilLairBg = LK.getAsset('objEvilLairBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChildAt(objEvilLairBg, 0); currentLevel = 3; // Set currentLevel to 3 when objEvilLairBg is instantiated LK.getSound('objBossBattleSpeech01Sound').play(); // Play objBossBattleSpeechSound01 when currentLevel is set to 3 LK.setTimeout(function () { if (currentLevel === 3) { LK.getSound('objBossBattleHeroSound').play(); if (currentLevel === 3) { var playLairMusicLoop = function playLairMusicLoop() { LK.getSound('objLairMusicSound').play(); LK.setTimeout(playLairMusicLoop, 10000); }; LK.setTimeout(playLairMusicLoop, 5000); } } }, 3000); }; }, 4000); }, 2000); } }, 3000); } LK.setTimeout(function () { if (self) { self.destroy(); } }, 150 + Math.random() * 100); // Check if objFireElementalBall is out of screen self.destroy(); } }; }); var objLeaf = Container.expand(function () { var self = Container.call(this); var leafGraphics = self.attachAsset('objLeaf', { anchorX: 0.5, anchorY: 0.5 }); self.speedY = 1 + Math.random() * 2; // Random vertical speed downwards // Randomly flip the leaf on the x-axis if (Math.random() < 0.5) { self.scale.x *= -1; } self.update = function () { self.y += self.speedY; // Add a slight oscillation effect to mimic a falling leaf self.x += Math.sin(LK.ticks / 20) * 2; // Destroy the leaf if it goes out of the screen if (self.y > 2732) { self.destroy(); } }; }); var objSnakeSpit = Container.expand(function () { var self = Container.call(this); var spitGraphics = self.attachAsset('objSnakeSpit', { anchorX: 0.5, anchorY: 0.5 }); LK.getSound('objSnakeAttack01').play(); self.speed = 10; self.update = function () { if (!objHeroHealthDisplay) { return; } var directionX = objHeroHealthDisplay.x - self.x; var directionY = objHeroHealthDisplay.y - self.y; var magnitude = Math.sqrt(directionX * directionX + directionY * directionY); var angle = Math.atan2(directionY, directionX); var curveFactor = 0.9; // Adjust this value to change the curvature angle += Math.sin(LK.ticks / 100) * curveFactor; self.x += Math.cos(angle) * self.speed; self.y += Math.sin(angle) * self.speed; if (self.intersects(objHeroHealthDisplay)) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (self.intersects(objBarrier)) { self.destroy(); } }; }); var objStalactite = Container.expand(function () { var self = Container.call(this); var stalactiteGraphics = self.attachAsset('objStalactite', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 20; self.update = function () { self.y += self.speed; if (self.intersects(objHeroHealthDisplay)) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (self.intersects(objBarrier)) { self.destroy(); } else if (self.y > 2732 + 100) { self.destroy(); } }; }); var objWraith = Container.expand(function () { var self = Container.call(this); var wraithGraphics = self.attachAsset('objWraith', { anchorX: 0.5, anchorY: 0.5 }); // Hover effect variables var hoverSpeed = 6; // Adjust the speed of the hover effect var direction = 1; // 1 for right, -1 for left self.update = function () { // Check for collision with objFireball if (self.intersects(objFireball) && !objFireball.dealtDamage) { LK.effects.flashObject(self, 0xff0000, 1000); // Flash red for 1 second wraithHP -= 1; objFireball.dealtDamage = true; if (wraithHP <= 0) { LK.effects.flashObject(self, 0xff0000, 3000); // Flash red for 3 seconds if wraithHP is 0 LK.setTimeout(function () { if (self) { self.destroy(); LK.clearInterval(self.boneTimer); } }, 3000); } LK.setTimeout(function () { if (objFireball) { objFireball.destroy(); objFireball = null; } }, 150 + Math.random() * 100); } // Add slight up and down motion self.y += Math.sin(LK.ticks / 20) * 2; // Move the wraith left or right self.x += direction * hoverSpeed; // Check if the wraith has reached the left or right edge of the playspace if (self.x <= 100 || self.x >= 1948 || self.y <= 100 || self.y >= 2632) { direction *= -1; // Reverse direction } if (!self.boneLargeTimer) { self.boneLargeTimer = LK.setInterval(function () { if (objWraith && Math.random() < 0.3) { var newBoneLarge = new objBoneLarge(); newBoneLarge.x = self.x; newBoneLarge.y = self.y; game.addChild(newBoneLarge); LK.getSound('objWraithAttack01').play(); } }, 5000); // 5-second delay before checking again } if (wraithHP <= 0) { var fadeOutDuration = 2000; // 2 seconds var fadeOutInterval = 100; // Interval for alpha reduction var fadeOutSteps = fadeOutDuration / fadeOutInterval; var alphaStep = self.alpha / fadeOutSteps; var fadeOutTimer = LK.setInterval(function () { if (self.alpha > 0) { self.alpha -= alphaStep; } else { LK.getSound('objWraithDeathSound').play(); self.destroy(); // Destroy all objBones when objWraith is destroyed game.children.forEach(function (child) { if (child instanceof objBone) { child.destroy(); } }); // Stop the objBones timer LK.clearInterval(self.boneTimer); LK.clearInterval(fadeOutTimer); } }, fadeOutInterval); } }; // Function to spawn objBone function spawnBones() { self.boneTimer = LK.setInterval(function () { if (!objWraith) { LK.clearInterval(self.boneTimer); return; } if (!objWraith) { LK.clearInterval(self.boneTimer); return; } var newBone = new objBone(); newBone.x = self.x; newBone.y = self.y; game.addChild(newBone); // Play objWraithAttack01 sound when objBone is instantiated LK.getSound('objWraithAttack01').play(); }, 1500); // Stop spawning after 4.5 seconds and take a 5-second break LK.setTimeout(function () { LK.clearInterval(self.boneTimer); LK.setTimeout(spawnBones, 5000); }, 4500); } // Start the spawning cycle spawnBones(); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var batTimerStarted = false; var snakeTimerStarted = false; var wraithTimerStarted = false; var wraithTimer; var wraithTimerText; var snakeTimer; var snakeTimerText; var batTimer; var batTimerText; // Placeholder function for loading the forest level function loadForestLevel() { // TODO: Implement the forest level } var currentLevel = ['intro', 'Forest', 'Crypt', 'Lair']; var objEvilForestBg; var objEvilCryptBg = LK.getAsset('objEvilCryptBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objEvilCryptBg); var objHeroHealth = 1; var snakeHP = 2; var wraithHP = 2; var objHero = null; var bossHP = 30; var bosshp = 30; var objHeroHealthDisplay, objAttack, objDefense, objBat, objBarrier, objSnake = null; var objFireball; var objWraith; var objTutorialSign = null; var objBat = null; var batHP = 2; if (currentLevel[0] === 'intro') { LK.getSound('objTitleScreenMusic').play(); LK.setInterval(function () { if (currentLevel[0] === 'intro') { LK.getSound('objTitleScreenMusic').play(); } }, 4000); var objTitleScreenBg = LK.getAsset('objTitleScreenBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objTitleScreenBg); var objTitleScreenFlame = LK.getAsset('objTitleScreenFlame', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 280, y: 2732 / 2 - 225 }); game.addChild(objTitleScreenFlame); var objTitleScreenFrame = LK.getAsset('objTitleScreenFrame', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 50 }); game.addChild(objTitleScreenFrame); var objTitleScreenPapyrus2 = LK.getAsset('objTitleScreenPapyrus2', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 - 1635 }); game.addChild(objTitleScreenPapyrus2); var objTitleScreenText = LK.getAsset('objTitleScreenText', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 20, y: 2732 / 2 - 825 }); var storyText = ["Once upon a time", "there was a hero", "seeking a lost", "enchanted artifact.", "The hero fought fierce", "monsters and faced", "great challenges alone.", "After many struggles,", "the hero found", "the artifact", "glowing with magic.", "The hero saved", "the kingdom and", "the hero's legend grew", "forever inspiring all."]; var currentLine = 0; var storyYPosition = 2732 / 2 - 50; // Center the story vertically var textLine = new Text2(storyText[currentLine], { size: 60, fill: "#ffffff", fontWeight: 'bold', font: 'Impact' }); textLine.anchor.set(0.5, 0); textLine.x = 2048 / 2; textLine.y = storyYPosition; game.addChild(textLine); game.addChild(objTitleScreenText); var objTitleScreenPapyrus = LK.getAsset('objTitleScreenPapyrus', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 1850 }); game.addChild(objTitleScreenPapyrus); var objTitleScreenStart = LK.getAsset('objTitleScreenStart', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 1250 }); game.addChild(objTitleScreenStart); // Create a timer to toggle the visibility of objTitleScreenStart every 0.5 second var toggleVisibility = LK.setInterval(function () { objTitleScreenStart.visible = !objTitleScreenStart.visible; }, 500); var changeText = LK.setInterval(function () { currentLine++; if (currentLine >= storyText.length) { currentLine = 0; } textLine.setText(storyText[currentLine]); }, 1500); // Create a timer to flip objTitleScreenFlame on the x axis every 0.1 seconds var flipFlame = LK.setInterval(function () { objTitleScreenFlame.scale.x *= -1; }, 100); // Add a click event to the start button to transition to the forest level game.update = function () { // Animate the story text to make it do a little wave textLine.y = storyYPosition + Math.sin(LK.ticks / 10) * 20; // Animate objBat to make it float a little bit if (currentLevel === 1) { if (objBat && objBat.spikeTimer) { objBat.y = 2732 / 2 - 500 + Math.sin(LK.ticks / 10) * 10; if (!batTimerStarted) { batTimerStarted = true; batTimer = 0; if (!batTimerText) { if (!batTimerText) { batTimerText = new Text2('0', { size: 50, fill: "#ff0000" }); batTimerText.anchor.set(0, 0); batTimerText.x = 50; batTimerText.y = 50; LK.gui.topLeft.addChild(batTimerText); } } } batTimer++; if (batTimerText) { batTimerText.setText(Math.floor(batTimer / 60) + ":" + (batTimer % 60).toString().padStart(2, '0')); } if (snakeTimerStarted && snakeTimerText) { snakeTimer++; snakeTimerText.setText(Math.floor(snakeTimer / 60) + ":" + (snakeTimer % 60).toString().padStart(2, '0')); } } } if (currentLevel === 1 && LK.ticks % 300 === 0) { for (var i = 0; i < 5; i++) { // Create 5 leaves var newLeaf = new objLeaf(); newLeaf.x = Math.random() * 2048; // Random x position at the top newLeaf.y = Math.random() * 100; // Start somewhere in the upper portion of the playspace // Set random scale for the leaf var scaleOptions = [0.9, 0.8, 0.7, 0.6]; var randomScale = scaleOptions[Math.floor(Math.random() * scaleOptions.length)]; newLeaf.scale.set(randomScale); // Randomly flip the leaf on the x-axis if (Math.random() < 0.5) { newLeaf.scale.x *= -1; } game.addChild(newLeaf); } // 300 ticks = 5 seconds at 60 FPS LK.getSound('objForestSound').play(); } if (currentLevel === 2) { // Destroy all objLeaf instances game.children.forEach(function (child) { if (child instanceof objLeaf) { child.destroy(); } }); } if (currentLevel === 2 && LK.ticks % 600 === 0) { // 600 ticks = 10 seconds at 60 FPS LK.getSound('objLairMusicSound').play(); } // Rotate objBarrier slowly if it exists if (objBarrier) { objBarrier.rotation += 0.02; // Adjust the increment value for desired rotation speed if (objDefense) { objDefense.alpha = 0.3; // Ensure objDefense alpha is 0.3 while objBarrier is active } if (objAttack) { objAttack.alpha = 0.3; // Ensure objAttack alpha is 0.3 while objBarrier is active } } else { if (objDefense) { objDefense.alpha = 1; // Reset objDefense alpha to 1 when objBarrier is not active } if (objAttack) { objAttack.alpha = 1; // Reset objAttack alpha to 1 when objBarrier is not active objAttack.down = function (x, y, obj) { // Handle the down event for objAttack if (objFireball) { return; // Exit the function if objFireball already exists } console.log("objAttack was pressed at", x, y); // Initialize and instantiate objFireball objFireball = LK.getAsset('objFireball', { anchorX: 0.5, anchorY: 0.5, x: objHero.x - 150, y: objHero.y - 250 }); // Add objFireball to the game game.addChild(objFireball); // Play objFireballSound when objFireball is instantiated LK.getSound('objFireballSound').play(); }; } } // Rotate objBarrierElementalDefense if it exists game.children.forEach(function (child) { if (child instanceof objBarrierElementalDefense) { child.rotation -= 0.1; // Adjust the increment value for desired counter-clockwise rotation speed child.update(); // Ensure the update method is called } }); if (objBat) { if (objBat && !objBat.spikeTimer) { objBat.spikeTimer = LK.setInterval(function () { if (objBat) { var newSpike = new objBatSpike(); newSpike.x = objBat.x; newSpike.y = objBat.y + 150; game.addChild(newSpike); } }, 4000 + Math.random() * 2000); } } if (objSnake && !objSnake.spitTimer) { objSnake.spitTimer = LK.setInterval(function () { if (objSnake) { var newSpit = new objSnakeSpit(); newSpit.x = objSnake.x; newSpit.y = objSnake.y + 250; game.addChild(newSpit); } }, 2500 + Math.random() * 2000); } if (batHP <= 0 && objBat) { // Gradually reduce bat's alpha over 2 seconds before destroying it var fadeOutDuration = 2000; // 2 seconds var fadeOutInterval = 100; // Interval for alpha reduction var fadeOutSteps = fadeOutDuration / fadeOutInterval; var alphaStep = objBat.alpha / fadeOutSteps; // Play objBatDeathSound while objBat is fading out var fadeOutTimer = LK.setInterval(function () { if (objBat && objBat.alpha > 0) { objBat.alpha -= alphaStep; } else { // Destroy the bat after fading out if (objBat) { LK.getSound('objBatDeathSound').play(); // Store objBat's position before destruction var batX = objBat.x; var batY = objBat.y; objBat.destroy(); // Add a 1 second delay before instantiating objForestNext LK.setTimeout(function () { // Check if objForestNext already exists if (!game.children.some(function (child) { return child.assetId === 'objForestNext'; })) { // Instantiate objForestNext in place of objBat var objForestNext = LK.getAsset('objForestNext', { anchorX: 0.5, anchorY: 0.5, x: batX, y: batY + 500, alpha: 0 }); game.addChild(objForestNext); var fadeInDuration = 1000; // 1 second var fadeInInterval = 100; // Interval for alpha increase var fadeInSteps = fadeInDuration / fadeInInterval; var alphaStep = 1 / fadeInSteps; var fadeInTimer = LK.setInterval(function () { if (objForestNext.alpha < 1) { objForestNext.alpha = Math.min(objForestNext.alpha + alphaStep, 1); objForestNext.alpha += alphaStep; } else { objForestNext.alpha = 1; LK.clearInterval(fadeInTimer); } }, fadeInInterval); objForestNext.down = function (x, y, obj) { objForestNext.destroy(); objSnake = LK.getAsset('objSnake', { anchorX: 0.5, anchorY: 0.5, x: objForestNext.x, y: objForestNext.y - 675 }); game.addChild(objSnake); snakeTimer = 0; snakeTimerText = new Text2('0', { size: 50, fill: "#00ff00" }); snakeTimerText.anchor.set(0, 0); snakeTimerText.x = 50; snakeTimerText.y = 100; LK.gui.topLeft.addChild(snakeTimerText); snakeTimerStarted = true; snakeTimer++; }; } }, 1000); } if (objBat && objBat.spikeTimer) { LK.clearInterval(objBat.spikeTimer); objBat.spikeTimer = null; } // Destroy all objBatSpike instances and their trails game.children.forEach(function (child) { if (child instanceof objBatSpike) { child.trail.forEach(function (segment) { segment.destroy(); }); child.destroy(); } }); objBat = null; // Ensure batTimerText is not destroyed batTimerText.visible = true; LK.clearInterval(fadeOutTimer); } }, fadeOutInterval); } else if (objFireball) { if (objAttack) { objAttack.alpha = 0.3; // Ensure objAttack alpha is 0.3 while objFireball is active } objFireball.y -= 25; // Move objFireball upwards objFireball.x += 1; // Move objFireball slightly to the right // Alternate objFireball's x axis every 0.1 seconds if (LK.ticks % 6 == 0) { objFireball.scale.x *= -1; } if (objFireball && objBat && objFireball.intersects(objBat) && !objFireball.dealtDamage || objFireball && objBossPhase2 && objFireball.intersects(objBossPhase2) && !objFireball.dealtDamage) { if (batHP === 1) { // Trigger flash effect on objBat for 3 seconds if it's on its last life LK.effects.flashObject(objBat, 0xff0000, 3000); } else { // Trigger flash effect on objBat for 1.5 seconds LK.effects.flashObject(objBat, 0xff0000, 1500); } // Reduce bat's HP by 1 batHP -= 1; // Mark fireball as having dealt damage objFireball.dealtDamage = true; // Destroy objBat after the flash effect duration if (batHP <= 0) { LK.setTimeout(function () { if (objBat) { objBat.destroy(); objBat = null; } }, batHP === 0 ? 3000 : 1500); } // Generate a random delay between 0.15 and 0.25 seconds (150 to 250 milliseconds) var randomDelay = 150 + Math.random() * 100; // Use LK.setTimeout to delay the destruction of the fireball LK.setTimeout(function () { if (objFireball) { objFireball.destroy(); objFireball = null; // Allow future instantiations } }, randomDelay); } else if (objFireball && objWraith && objFireball.intersects(objWraith) && !objFireball.dealtDamage) { LK.effects.flashObject(objWraith, 0xff0000, 1000); // Flash red for 1 second wraithHP -= 1; objFireball.dealtDamage = true; if (wraithHP <= 0) { LK.effects.flashObject(objWraith, 0xff0000, 3000); LK.setTimeout(function () { if (objWraith) { objWraith.destroy(); objWraith = null; // Ensure wraithTimerText is not destroyed wraithTimerText.visible = true; // Ensure wraithTimerText is not destroyed wraithTimerText.visible = true; // Instantiate objDanger in the center of the playspace var objDanger = LK.getAsset('objDanger', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 50, y: 2732 / 2 - 100 }); game.addChild(objDanger); // Play objWatchOutSound when objDanger is instantiated LK.getSound('objWatchOutSound').play(); // Toggle visibility of objDanger every 0.5 seconds for 2 seconds var toggleVisibilityInterval = LK.setInterval(function () { objDanger.visible = !objDanger.visible; // Add screen shaking effect var shakeIntensity = 10; var originalX = game.x; var originalY = game.y; var shakeInterval = LK.setInterval(function () { game.x = originalX + (Math.random() - 0.5) * shakeIntensity; game.y = originalY + (Math.random() - 0.5) * shakeIntensity; }, 50); LK.setTimeout(function () { LK.clearInterval(shakeInterval); game.x = originalX; game.y = originalY; }, 500); }, 500); LK.setTimeout(function () { LK.clearInterval(toggleVisibilityInterval); objDanger.visible = true; // Ensure objDanger is visible after the effect objDanger.destroy(); // Destroy objDanger after 2 seconds // Instantiate 7 objStalactite instances at different x and y positions outside of the upper portion of the playspace for (var i = 0; i < 7; i++) { var stalactite = new objStalactite(); stalactite.x = Math.random() * 2048; stalactite.y = Math.random() * -500; // Random y position above the playspace game.addChild(stalactite); } // Wait four seconds after objDanger is destroyed and instantiate objCryptLeave in the center of the playspace LK.setTimeout(function () { var objCryptLeave = LK.getAsset('objCryptLeave', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objCryptLeave); objCryptLeave.down = function (x, y, obj) { objCryptLeave.destroy(); // Replace objEvilCryptBg with objEvilLairBg game.removeChild(objEvilCryptBg); var objEvilLairBg = LK.getAsset('objEvilLairBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChildAt(objEvilLairBg, 0); currentLevel = 3; // Set currentLevel to 3 when objEvilLairBg is instantiated LK.getSound('objBossBattleSpeech01Sound').play(); // Play objBossBattleSpeechSound01 when currentLevel is set to 3 LK.setTimeout(function () { if (currentLevel === 3) { LK.getSound('objBossBattleHeroSound').play(); if (currentLevel === 3) { var playLairMusicLoop = function playLairMusicLoop() { LK.getSound('objLairMusicSound').play(); LK.setTimeout(playLairMusicLoop, 10000); }; LK.setTimeout(playLairMusicLoop, 5000); } } }, 3000); }; }, 4000); }, 2000); } }, 3000); } LK.setTimeout(function () { if (objFireball) { objFireball.destroy(); objFireball = null; } }, 150 + Math.random() * 100); } else if (objFireball && objSnake && objFireball.intersects(objSnake) && !objFireball.dealtDamage) { snakeHP -= 1; objFireball.dealtDamage = true; // Trigger a red flash effect on objSnake LK.effects.flashObject(objSnake, 0xff0000, 1000); if (snakeTimerStarted == true) { if (snakeTimerStarted && snakeTimerText) { snakeTimer++; snakeTimerText.setText(Math.floor(snakeTimer / 60) + ":" + (snakeTimer % 60).toString().padStart(2, '0')); } } if (snakeHP <= 0) { // Gradually reduce objSnake's alpha over 2 seconds before destroying it var fadeOutDuration = 2000; // 2 seconds var fadeOutInterval = 100; // Interval for alpha reduction var fadeOutSteps = fadeOutDuration / fadeOutInterval; var alphaStep = objSnake.alpha / fadeOutSteps; var fadeOutTimer = LK.setInterval(function () { LK.getSound('objSnakeDeathSound').play(); if (objSnake && objSnake.alpha > 0) { objSnake.alpha -= alphaStep; objSnake.tint = 0xff0000; // Apply red tint during fade out } else { if (objSnake) { objSnake.destroy(); objSnake = null; // Ensure snakeTimerText is not destroyed snakeTimerText.visible = true; // Ensure snakeTimerText is not destroyed snakeTimerText.visible = true; game.children.forEach(function (child) { if (child instanceof objSnakeSpit) { child.destroy(); } }); // Instantiate objPowerUpChest in the center of the playspace var objPowerUpChest = LK.getAsset('objPowerUpChest', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 25, y: 2732 / 2 + 375 }); game.addChild(objPowerUpChest); objPowerUpChest.down = function (x, y, obj) { objPowerUpChest.destroy(); LK.getSound('objAlrightSound').play(); var pwrUpText = new PwrUpText(); pwrUpText.x = objHero.x - 50; pwrUpText.y = objHero.y - 550; game.addChild(pwrUpText); LK.getSound('objTreasureSound').play(); var fireElemental = new objFireElemental(); game.addChild(fireElemental); LK.setTimeout(function () { var objForestLeave = LK.getAsset('objForestLeave', { anchorX: 0.5, anchorY: 0.5, x: objPowerUpChest.x, y: objPowerUpChest.y - 500 }); game.addChild(objForestLeave); objForestLeave.down = function (x, y, obj) { objForestLeave.destroy(); // Destroy all objLeaf instances game.children.forEach(function (child) { if (child instanceof objLeaf) { child.destroy(); } }); wraithTimer = 0; wraithTimerText = new Text2('0', { size: 50, fill: "#ADD8E6" }); wraithTimerText.anchor.set(0, 0); wraithTimerText.x = 50; wraithTimerText.y = 150; // Position below snakeTimerText LK.gui.topLeft.addChild(wraithTimerText); wraithTimerStarted = true; // Swap positions of objEvilForestBg and objEvilCryptBg game.removeChild(objEvilForestBg); game.addChildAt(objEvilCryptBg, 0); currentLevel = 2; // Set currentLevel to 2 when objEvilCryptBg is instantiated // Instantiate objWraith in the center of the playspace objWraith = new objWraith(); objWraith.x = 2048 / 2 - 300; objWraith.y = 2732 / 2 - 525; game.addChild(objWraith); }; }, 2000); }; } LK.clearInterval(fadeOutTimer); } }, fadeOutInterval); } // Generate a random delay between 0.15 and 0.25 seconds (150 to 250 milliseconds) var randomDelay = 150 + Math.random() * 100; // Use LK.setTimeout to delay the destruction of the fireball LK.setTimeout(function () { if (objFireball) { objFireball.destroy(); objFireball = null; // Allow future instantiations } }, randomDelay); } else if (objFireball.y < 0) { // Check if objFireball is out of screen objFireball.destroy(); objFireball = null; // Allow future instantiations } } else { if (objAttack && !objBarrier) { objAttack.alpha = 1; // Reset objAttack alpha to 1 when objFireball and objBarrier are not active } if (objHeroHealth <= 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } // Instantiate objBossPhase1 in the center of the playspace if currentLevel is 3 if (currentLevel === 3 && !game.children.some(function (child) { return child instanceof objBossPhase1; })) { var bossPhase1 = new objBossPhase1(); bossPhase1.x = 2048 / 2 + 100; bossPhase1.y = 2732 / 2 + 200; game.addChild(bossPhase1); LK.setTimeout(function () { bossPhase1.visible = 0; }, 5000); LK.setTimeout(function () { LK.effects.flashScreen(0xffffff, 3000); }, 5000); LK.setTimeout(function () { var bossPhase2 = new objBossPhase2(); bossPhase2.x = 2048 / 2 + 50; bossPhase2.y = 2732 / 2 - 150; game.addChild(bossPhase2); }, 5000); } } if (snakeTimerStarted == true && snakeHP > 0) { if (snakeTimerStarted && snakeTimerText) { snakeTimer++; snakeTimerText.setText(Math.floor(snakeTimer / 60) + ":" + (snakeTimer % 60).toString().padStart(2, '0')); } } if (wraithTimerStarted == true && wraithHP > 0) { if (wraithTimerStarted && wraithTimerText) { wraithTimer++; wraithTimerText.setText(Math.floor(wraithTimer / 60) + ":" + (wraithTimer % 60).toString().padStart(2, '0')); } } }; var introClicked = false; game.down = function (x, y, obj) { // Only transition to the forest level if the current level is 'intro' and intro has not been clicked yet if (currentLevel[0] === 'intro' && !introClicked) { introClicked = true; // Play objTitleScreenStartSound LK.getSound('objTitleScreenStartSound').play(); // Delay the execution of the rest of the script by one second LK.setTimeout(function () { // Clear the intro screen game.removeChildren(); // Transition to the forest level currentLevel[1] = 'Forest'; // Load the forest level directly if (currentLevel[1] === 'Forest') { objEvilForestBg = LK.getAsset('objEvilForestBg', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); game.addChild(objEvilForestBg); objBat = LK.getAsset('objBat', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 - 500 }); game.addChild(objBat); // Initialize and start the timer for objBat encounter batTimer = 0; batTimerText = new Text2('0', { size: 50, fill: "#ff0000" }); batTimerText.anchor.set(0, 0); batTimerText.x = 50; batTimerText.y = 50; LK.gui.topLeft.addChild(batTimerText); objTutorialSign = LK.getAsset('objTutorialSign', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 250 }); game.addChild(objTutorialSign); LK.getSound('objDieMonsterSound').play(); LK.setTimeout(function () { if (objTutorialSign) { objTutorialSign.destroy(); objTutorialSign = null; } }, 3000); if (!objHero) { objHero = LK.getAsset('objHero', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 100, y: 2732 / 2 + 1100 }); objHeroHealthDisplay = LK.getAsset('objHeroHealth', { anchorX: 0.5, anchorY: 0.5, x: objHero.x - 55, y: objHero.y - 175 }); game.addChild(objHeroHealthDisplay); game.addChild(objHero); } if (!objAttack) { objAttack = LK.getAsset('objAttack', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 - 600, y: 2732 / 2 + 1100 }); game.addChild(objAttack); objAttack.down = function (x, y, obj) { // Handle the down event for objAttack if (objFireball) { return; // Exit the function if objFireball already exists } console.log("objAttack was pressed at", x, y); // Initialize and instantiate objFireball objFireball = LK.getAsset('objFireball', { anchorX: 0.5, anchorY: 0.5, x: objHero.x - 150, y: objHero.y - 250 }); // Add objFireball to the game game.addChild(objFireball); // Play objFireballSound when objFireball is instantiated LK.getSound('objFireballSound').play(); }; } if (!objDefense) { objDefense = LK.getAsset('objDefense', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 650, y: 2732 / 2 + 1120 }); game.addChild(objDefense); objDefense.down = function (x, y, obj) { // Handle the down event for objDefense console.log("objDefense was pressed at", x, y); // Check if objBarrier is already instantiated if (objBarrier) { return; // Exit the function if objBarrier already exists } // Initialize and instantiate objBarrier objBarrier = LK.getAsset('objBarrier', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 800 }); // Set objDefense alpha to 0.3 objDefense.alpha = 0.3; // Set objAttack alpha to 0.3 if (objAttack) { objAttack.alpha = 0.3; // Disable objAttack down listener objAttack.down = null; } // Set 50% transparency objBarrier.alpha = 0.5; // Add objBarrier to the game game.addChild(objBarrier); // Play objBarrierSound when objBarrier is instantiated LK.getSound('objBarrierSound').play(); // Destroy objBarrier after three seconds LK.setTimeout(function () { if (objBarrier) { objBarrier.destroy(); objBarrier = null; // Reset objBarrier to allow future instantiations objDefense.alpha = 1; // Reset objDefense alpha to 1 // Reset objAttack alpha to 1 and re-enable its down listener if (objAttack) { objAttack.alpha = 1; objAttack.down = function (x, y, obj) { // Handle the down event for objAttack if (objFireball) { return; // Exit the function if objFireball already exists } console.log("objAttack was pressed at", x, y); // Initialize and instantiate objFireball objFireball = LK.getAsset('objFireball', { anchorX: 0.5, anchorY: 0.5, x: objHero.x - 150, y: objHero.y - 250 }); // Add objFireball to the game game.addChild(objFireball); // Play objFireballSound when objFireball is instantiated LK.getSound('objFireballSound').play(); }; } } }, 2000); }; } currentLevel = 1; } }, 1000); } }; }
===================================================================
--- original.js
+++ change.js
@@ -230,18 +230,15 @@
x: 2048 / 2,
y: 2732 / 2
});
game.addChild(objEndGameBg);
- console.log("second possible loading of the background");
- game.addChild(objEndGameBg);
var objEpisodeOne = LK.getAsset('objEpisodeOne', {
anchorX: 1.0,
anchorY: 1.0,
- x: 2048 / 2 + 850,
- y: 2732 / 2 + 1200
+ x: 2048 / 2 + 950,
+ y: 2732 / 2 + 1300
});
game.addChild(objEpisodeOne);
- console.log("added the object");
objEpisodeOne.visible = true; // Ensure objEpisodeOne is visible
LK.showGameOver();
}
// Shimmy effect: move slowly from right to left
A wizard hero facing away with his back turned with his staff in the air I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. The environment should have a rich, fantasy-themed design with intricate backgrounds and a nostalgic, old-school feel.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A campfire setting with a teacher and kids sitting down. Everyone dressed as wizards. I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. The environment should have a rich, fantasy-themed design with intricate backgrounds and a nostalgic, old-school feel.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
"A Hero's Tale" title screen text I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. The environment should have a rich, fantasy-themed design with intricate backgrounds and a nostalgic, old-school feel.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Wooden engrained frame. I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. The environment should have a rich, fantasy-themed design with intricate backgrounds and a nostalgic, old-school feel.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
purple flame. I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
evil enchanted dark forest background, 1st person perspective, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
evil large flying bat, front view, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
fireball spell icon with a frame, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue shield spell icon with a frame, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bone spike, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Text that says Defeat the creature, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue semi transparent magical seal, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A mythical treasure chest, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
evil enchanted dark catacombs background, 1st person perspective, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
evil enchanted dark catacombs background, 1st person perspective, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a single blue gray skeleton bone, front view, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
danger sign with an exclamation mark and the word 'danger' written on it, front view, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
crystal tube, front view, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
ancient artifact, front facing, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
high definition closeup for a game titled "A Hero's Tale" and with the description "Embark on an epic quest as a powerful spellcaster, battle fierce foes across diverse and unique locations uncovering treasures.". Show text "Thanks for playing" Show Purple Spellcaster, show evil monster. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a single brown leaf, front facing, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors.... Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
text that says 'To Be Continued', front facing, I want the art style to reflect a classic 16-bit retro pixel art aesthetic, reminiscent of early 1990s RPGs with vibrant colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
objTitleScreenMusic
Sound effect
objTitleScreenStartSound
Sound effect
objFireballSound
Sound effect
objBarrierSound
Sound effect
objBatDeathSound
Sound effect
objBatAttack01
Sound effect
objSnakeAttack01
Sound effect
objSnakeDeathSound
Sound effect
objTreasureSound
Sound effect
objWraithAttack01
Sound effect
objWraithDeathSound
Sound effect
objDieMonsterSound
Sound effect
objAlrightSound
Sound effect
objWatchOutSound
Sound effect
objLairMusicSound
Sound effect
objBossBattleSpeech01Sound
Sound effect
objBossBattleHeroSound
Sound effect
objForestSound
Sound effect