User prompt
boxBackground.x = 400; boxBackground.y = 2532;
User prompt
move box a bit to the right
User prompt
move box to the right
User prompt
move box at the bottom left corner
User prompt
if left click is pressed box should move up by 100
User prompt
if barn moves down, box should move down by +=100
User prompt
match the box movement to room1
User prompt
Create a new room called Box and do not replace the existing room1Background asset creation and setup.
User prompt
if barn moves down, obstacles should also move down with it
User prompt
include the obstacles inside the if barn move down statement and copy the value of room1background
User prompt
Fix Bug: 'ReferenceError: largeObstacleBox is not defined' in this line: 'largeObstacleBox.y -= 100;' Line Number: 77
User prompt
if left click is pressed, LargeObstacleBox.y -= 100;
User prompt
if left click pressed all obstacles y -= 100;
User prompt
all obstacles should move similar to room1
User prompt
remove room1 from moving on left click pressed
User prompt
room1 should not move
User prompt
do not make room1 move
User prompt
Fix Bug: 'TypeError: crosshair.move is not a function' in this line: 'crosshair.move(obj.event);' Line Number: 61
User prompt
Fix Bug: 'TypeError: santa.move is not a function' in this line: 'santa.move();' Line Number: 127
User prompt
Fix Bug: 'TypeError: santa.move is not a function' in this line: 'santa.move();' Line Number: 127
User prompt
they are moving.. i said no moving
User prompt
make sure the obstacle boxes are on the same layer as santa and they do not move
User prompt
put all obstacles on the same layer as santa
User prompt
obstacle boxes should still be visible on the layer above room1
User prompt
all obstacle boxes should be static
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); self.show = function () { self.visible = true; LK.setTimeout(function () { self.visible = false; }, 100); }; }); var Santa = Container.expand(function () { var self = Container.call(this); self.santaGraphics = self.createAsset('santa', 'Santa character', .5, .5); self.move = function () {}; self.shoot = function () {}; }); var Crosshair = Container.expand(function () { var self = Container.call(this); self.move = function (event) { var pos = event.getLocalPosition(self.parent); self.x = pos.x; self.y = pos.y; }; var crosshairGraphics = self.createAsset('crosshair', 'Crosshair', .5, .5); self.y = -crosshairGraphics.height / 2; self.destroy = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); stage.on('move', function (obj) { crosshair.move(obj.event); }); stage.on('down', function (obj) { muzzleFlash.show(); leftClickPressed = true; lastClickTime = LK.ticks; if (!barnMovedDown) { barnBackground.y += 460; room1Background.y += 100; boxBackground.y += 100; barnMovedDown = true; } }); var room1Background = self.createAsset('Room1', 'Room1 background', 0, 0); room1Background.anchor.set(0.5, 0.5); room1Background.x = 2048 / 2; room1Background.y = 2732 / 2; self.addChild(room1Background); var boxBackground = self.createAsset('Box', 'Box background', 1, 1); boxBackground.anchor.set(1, 1); boxBackground.x = 2048; boxBackground.y = 2732; self.addChild(boxBackground); var barnBackground = self.createAsset('Barn', 'Barn background', 0, 0); barnBackground.anchor.set(0.5, 0.5); barnBackground.x = 2048 / 2; barnBackground.y = 2732 - barnBackground.height / 4 + 900; self.addChild(barnBackground); var santa = new Santa(); santa.x = 2048 - santa.santaGraphics.width / 2; santa.y = 2732 - santa.santaGraphics.height / 2; self.addChild(santa); var muzzleFlash = new MuzzleFlash(); muzzleFlash.x = santa.x - santa.santaGraphics.width + 400; muzzleFlash.y = santa.y - 90; self.addChild(muzzleFlash); self.addChild(santa); var crosshair = self.addChild(new Crosshair()); crosshair.x = 2048 / 2; crosshair.y = 2732 / 2; var isGameOver = false; 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 = 1150 + i * (heart.width + 1); heart.y = santa.y - santa.santaGraphics.height - heart.height / 2 + 350; hearts.push(heart); LK.gui.topLeft.addChild(heart); } LK.on('tick', function () { santa.move(); if (isGameOver) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } if (leftClickPressed && LK.ticks - lastClickTime > 30) { barnBackground.y -= 460; room1Background.y -= 100; boxBackground.y -= 100; leftClickPressed = false; barnMovedDown = false; } for (var a = crosshair.length - 1; a >= 0; a--) { crosshair[a].move(); if (crosshair[a].y < -50) { crosshair[a].destroy(); crosshair.splice(a, 1); } } }); });
===================================================================
--- original.js
+++ change.js
@@ -52,11 +52,11 @@
room1Background.anchor.set(0.5, 0.5);
room1Background.x = 2048 / 2;
room1Background.y = 2732 / 2;
self.addChild(room1Background);
- var boxBackground = self.createAsset('Box', 'Box background', 0, 0);
- boxBackground.anchor.set(0, 1);
- boxBackground.x = 0;
+ var boxBackground = self.createAsset('Box', 'Box background', 1, 1);
+ boxBackground.anchor.set(1, 1);
+ boxBackground.x = 2048;
boxBackground.y = 2732;
self.addChild(boxBackground);
var barnBackground = self.createAsset('Barn', 'Barn background', 0, 0);
barnBackground.anchor.set(0.5, 0.5);
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