User prompt
the clouds move form right to left. Separate the clouds to be in different positons and shapes. but them higher on the top of the screen.
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.addChild(cloud);' Line Number: 75
User prompt
add clouds moving from left to right slowly
User prompt
fix bug the ground image sound not be covered by the background image
User prompt
Fix Bug: 'Uncaught ReferenceError: groundGraphics is not defined' in this line: 'background.height = 2732 - ground.height - groundGraphics.height;' Line Number: 99
User prompt
Fix Bug: 'Uncaught ReferenceError: groundGraphics is not defined' in this line: 'background.height = 2732 - ground.height - groundGraphics.height;' Line Number: 99
User prompt
the ground image overlaps with the background image
User prompt
the ground image is infrom of the background
User prompt
add a background that covers the screen from the ground image to the top of the screen it is in the background and does not overlap with other assets
User prompt
the spead of the present falling increases as time passes and has a limit.
User prompt
increase and dicrease the santa image a few pixels while moving
User prompt
under the ground add a new ground named ground 2
User prompt
put the ground in the background so that id doesnt overlap with santa and the presents
User prompt
increase the bottom of the ground to cover the screen downwards
User prompt
expand the ground downwards to cover the screen
User prompt
add borders on the ground so that eh presents disappear when they touch it
User prompt
move the ground image under santa
User prompt
when santa moves either left or right rotate the image left and right to look like it is moving
User prompt
when santa move change the scale of the image to simulate movement
User prompt
simulate movement by increasing and decreasing the santas image slightly when he moves
User prompt
Add a border on the ground so when the pressents colide they disapear
User prompt
when the pressents touch the ground they disappear
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'height')' in this line: 'groundGraphics.height = groundGraphics.texture.height * (LK.stageContainer.width / groundGraphics.texture.width);' Line Number: 5
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'height')' in this line: 'groundGraphics.height = groundGraphics.texture.height * (LK.stageContainer.width / groundGraphics.texture.width);' Line Number: 5
User prompt
the ground image covers all the bottom screen
var Ground = Container.expand(function () { var self = Container.call(this); var groundGraphics = self.createAsset('ground', 'Ground image', 0, 1); groundGraphics.width = 2048; self.addChild(groundGraphics); }); var Snowflake = Container.expand(function (santa) { var self = Container.call(this); self.santa = santa; var snowflakeGraphics = self.createAsset('snowflake', 'Snowflake icon', 0.5, 0.5); snowflakeGraphics.scale.set(0.5); self.drop = function () { self.y += 5; self.x -= 5; if (self.y > 2732 - self.santa.height || self.x < -self.width) { self.destroy(); } }; }); var GrayHeart = Container.expand(function () { var self = Container.call(this); var grayHeartGraphics = self.createAsset('grayHeart', 'Gray Heart icon', 0, 0); }); var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.createAsset('heart', 'Heart icon', 0, 0); }); var Santa = Container.expand(function () { var self = Container.call(this); var santaGraphics = self.createAsset('santa', 'Santa character', .5, .5); self.lastX = self.x; self.move = function (newX) { var halfWidth = this.width / 2; var oldX = this.x; this.x = Math.max(halfWidth, Math.min(2048 - halfWidth, newX)); if (oldX > this.x) { this.scale.x = 1; } else if (oldX < this.x) { this.scale.x = -1; } self.lastX = this.x; }; self.collect = function () {}; }); var Gift = Container.expand(function (dropSpeed) { var self = Container.call(this); self.dropSpeed = dropSpeed; var giftGraphics = self.createAsset('gift', 'Gift item', .5, .5); self.drop = function () { self.y += self.dropSpeed; var wiggle = (Math.random() - 0.5) * 10; self.x += wiggle; self.x = Math.max(self.width / 2, Math.min(2048 - self.width / 2, self.x)); }; }); var Game = Container.expand(function () { var self = Container.call(this); var score = 0; var highestScore = 0; var scoreTxt = new Text2(score.toString(), { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(.5, 0); LK.gui.topCenter.addChild(scoreTxt); var lives = 3; var hearts = []; for (var i = 0; i < lives; i++) { var heart = new Heart(); heart.x = i * (heart.width + 10); heart.y = 10; hearts.push(heart); LK.gui.topLeft.addChild(heart); } var santa = self.addChild(new Santa()); var snowflakes = []; for (var i = 0; i < 10; i++) { var initialSnowflake = new Snowflake(santa); initialSnowflake.x = Math.random() * 2048; initialSnowflake.y = Math.random() * 2732; snowflakes.push(initialSnowflake); self.addChild(initialSnowflake); } var snowfallInterval = LK.setInterval(function () { for (var i = 0; i < 3; i++) { var snowflake = new Snowflake(santa); snowflake.x = 2048 + snowflake.width / 2; snowflake.y = Math.random() * 2732; snowflakes.push(snowflake); self.addChild(snowflake); } }, 1000); var gifts = []; santa.x = LK.stageContainer.width / 2; santa.y = 2732 - santa.height; var ground = new Ground(); var background = self.createAsset('background', 'Background image', 0, 0); background.width = 2048; background.height = 2732 - ground.height - ground.groundGraphics.height; self.addChildAt(background, 0); self.addChildAt(ground, self.children.length); var giftDropSpeed = 5; var maxGiftDropSpeed = 15; var giftSpeedIncreaseInterval = 10000; var lastSpeedIncreaseTime = 0; var giftCreationInterval = LK.setInterval(function () { var currentTime = Date.now(); if (currentTime - lastSpeedIncreaseTime >= giftSpeedIncreaseInterval && giftDropSpeed < maxGiftDropSpeed) { giftDropSpeed += 1; lastSpeedIncreaseTime = currentTime; } var gift = new Gift(giftDropSpeed); gift.x = Math.random() * 2048; gift.y = 0; gifts.push(gift); self.addChild(gift); }, 2000); LK.on('tick', function () { santa.move(); for (var j = 0; j < snowflakes.length; j++) { snowflakes[j].drop(); if (snowflakes[j].y > 2732) { snowflakes.splice(j, 1); j--; } } for (var i = 0; i < gifts.length; i++) { gifts[i].drop(); if (santa.intersects(gifts[i])) { santa.collect(gifts[i]); score++; if (score > highestScore) { highestScore = score; } scoreTxt.setText(score.toString()); gifts[i].destroy(); gifts.splice(i, 1); i--; if (hearts.length > 0) { var lostHeart = hearts[hearts.length - 1]; } } else if (gifts[i].y > 2732 - ground.height - gifts[i].height / 2) { gifts[i].destroy(); gifts.splice(i, 1); i--; if (--lives <= 0) { if (hearts.length > 0) { var lostHeart = hearts.pop(); lostHeart.destroy(); var grayHeart = new GrayHeart(); grayHeart.x = lostHeart.x; grayHeart.y = lostHeart.y; LK.gui.topLeft.addChild(grayHeart); } scoreTxt.setText('Highest Score: ' + highestScore.toString()); LK.showGameOver(); } else if (hearts.length > 0) { var lostHeart = hearts.pop(); lostHeart.destroy(); var grayHeart = new GrayHeart(); grayHeart.x = lostHeart.x; grayHeart.y = lostHeart.y; LK.gui.topLeft.addChild(grayHeart); } } } }); stage.on('down', function (obj) { var pos = obj.event.getLocalPosition(self); santa.move(pos.x); }); stage.on('move', function (obj) { var pos = obj.event.getLocalPosition(self); santa.move(pos.x); }); });
===================================================================
--- original.js
+++ change.js
@@ -95,9 +95,9 @@
santa.y = 2732 - santa.height;
var ground = new Ground();
var background = self.createAsset('background', 'Background image', 0, 0);
background.width = 2048;
- background.height = 2732 - ground.height - ground.children[0].height;
+ background.height = 2732 - ground.height - ground.groundGraphics.height;
self.addChildAt(background, 0);
self.addChildAt(ground, self.children.length);
var giftDropSpeed = 5;
var maxGiftDropSpeed = 15;
Pixelated Santa Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixeled Christmas present Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixalated heart empty Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixalated heart grey Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelated snow flake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
snowy ground image pixalated Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
snowy ground image pixalated 2D Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art a small image 2048 to serve as ground that has snow for a simple 2D game no trees not nothing only snow and ground to cover the ground width of the screen Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gif pixel art for game background, snow on the ground, houses in the far background and moonligh, trees on the left and right, cozy Christmas atmosphere Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.