User prompt
Change the position of the boxBackground to x=1450 and y=1900
User prompt
Change the position of the boxBackground to x=1400 and y=1800
User prompt
Change the y position of crateBackground to 2600
User prompt
Change crateBackground position to x=205
User prompt
Change crateBackground position to x=210
User prompt
crateBackground.y = 2645;
User prompt
crateBackground.y = 2632;
User prompt
crateBackground.y = 2732;
User prompt
Change crateBackground position to x=185
User prompt
Change crateBackground position to x=205
User prompt
Change crateBackground position to x=215
User prompt
Change crateBackground position to x=225
User prompt
boxBackground.x = 1500; boxBackground.y = 2000;
User prompt
crateBackground.x = 235; crateBackground.y = 2532;
User prompt
if left click is pressed crate should move up by 100
User prompt
Move the crate down by 100 when the barn moves down
User prompt
Create a new room called Crate without replacing the existing room1Background asset creation and setup.
User prompt
boxBackground.x = 235;
User prompt
boxBackground.x = 250; boxBackground.y = 2532;
User prompt
boxBackground.x = 300
User prompt
boxBackground.y = 2632;
User prompt
boxBackground.x = 300; boxBackground.y = 2532;
User prompt
boxBackground.x = 300; boxBackground.y = 2532;
User prompt
boxBackground.x = 350; boxBackground.y = 2532;
User prompt
boxBackground.x = 400; boxBackground.y = 2532;
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', 0, 0);
boxBackground.anchor.set(0, 1);
boxBackground.x = 400;
boxBackground.y = 2532;
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);
}
}
});
});
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