User prompt
heart.x = 130 + i * (heart.width + 100);
User prompt
move heart position a little bit to the right
User prompt
move heart position a little bit to the right
User prompt
barn should move but a tiny bit less
User prompt
barn should move but a tiny bit less
User prompt
barn should move but a tiny bit less
User prompt
room1 background should move but far less
User prompt
room1Background.y += 100;
User prompt
room1Background.y -= 100;
User prompt
room1 should also move when barn moves
User prompt
reposition the heart to the right
User prompt
move the hearts position at the bottom right of the screen
User prompt
center the hearts on santa
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'LK.gui.topLayer.addChild(heart);' Line Number: 83
User prompt
the hearts should be on the top layer
User prompt
put the hearts above santa
User prompt
draw 3 hearts which represents the players lives
User prompt
make muzzleflash disappear faster
User prompt
leftClickPressed && LK.ticks - lastClickTime > 30
User prompt
barn should move back up faster
User prompt
if barn moved down already it cannot move down again until it moved back up
User prompt
when left click is pressed lower the barn by annother 500 if left clicked is not pressed for more than 3 seconds raise the barn by 500
User prompt
barnBackground.y = 2732 - barnBackground.height / 4 + 900;
User prompt
barnBackground.y = 2732 - barnBackground.height / 4 + 300;
User prompt
barnBackground.y = 2732 - barnBackground.height / 4 + 800;
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,10 @@
+var Heart = Container.expand(function () {
+ var self = Container.call(this);
+ var heartGraphics = self.createAsset('heart', 'Player life', 0.5, 0.5);
+ self.x = heartGraphics.width / 2;
+ self.y = heartGraphics.height / 2;
+});
var MuzzleFlash = Container.expand(function () {
var self = Container.call(this);
self.visible = false;
var flashGraphics = self.createAsset('muzzleFlash', 'Muzzle flash effect', .5, .5);
@@ -66,8 +72,17 @@
var tickOffset = 0;
var leftClickPressed = false;
var barnMovedDown = false;
var lastClickTime = 0;
+ var playerLives = 3;
+ var hearts = [];
+ for (var i = 0; i < playerLives; i++) {
+ var heart = new Heart();
+ heart.x = 100 + i * (heart.width + 10);
+ heart.y = 100;
+ hearts.push(heart);
+ LK.gui.topLeft.addChild(heart);
+ }
LK.on('tick', function () {
santa.move();
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
over the shoulder santa firing a revolver Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d transparent christmas crosshair Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d 3rd person front view of a christmas town square with a starry sky Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Christmas sparkles png Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
circular christmas golden star pattern transparent png Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas brick wall Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d opened christmas crate Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d diagonal christmas car or truck in snow Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a christmas poster showcasing miss santa clause Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a single white snowflake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d stacked christmas winter tire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d stacked christmas winter tire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas magical mistletoe Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas 357 Magnum bullets Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d silhouette of a flying reindeer with a red glowy nose Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas dark sparkles Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d christmas evil robot elf with a gun Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
2d pile of gray and red nuts and bolts Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
transparent snow sphere. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
snd_pistol
Sound effect
snd_enemyshot
Sound effect
snd_obstacle
Sound effect
snd_messages
Sound effect
snd_ricochet
Sound effect
snd_reindeer
Sound effect
snd_mistletoe
Sound effect
snd_reindeershot
Sound effect
snd_mistletoeshot
Sound effect
snd_christmasmusic
Music
snd_reload
Sound effect
snd_blastwave
Sound effect