User prompt
Fix Bug: 'TypeError: parseInt is not a function' in this line: 'var highscore = Math.max(score, parseInt((typeof localStorage !== 'undefined' ? localStorage.getItem(highscoreKey) : '0') || '0', 10));' Line Number: 81
User prompt
Fix Bug: 'TypeError: parseInt is not a function' in this line: 'var highscore = Math.max(score, parseInt((typeof localStorage !== 'undefined' ? localStorage.getItem(highscoreKey) : '0') || '0', 10));' Line Number: 81
User prompt
Fix Bug: 'TypeError: parseInt is not a function' in this line: 'var highscore = Math.max(score, parseInt((typeof localStorage !== 'undefined' ? localStorage.getItem(highscoreKey) : '0') || '0'));' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'getItem')' in this line: 'var highscore = Math.max(score, parseInt(localStorage.getItem(highscoreKey) || '0'));' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'getItem')' in this line: 'var highscore = Math.max(score, parseInt(localStorage.getItem('highscore') || '0'));' Line Number: 80
User prompt
Fix Bug: 'TypeError: scoreText.set is not a function' in this line: 'scoreText.set({' Line Number: 76
User prompt
Fix Bug: 'TypeError: (intermediate value).set is not a function' in this line: 'LK.gui.topCenter.addChild(new Text2('Score: ' + score, {' Line Number: 72
User prompt
Fix Bug: 'TypeError: (intermediate value).set is not a function' in this line: 'LK.gui.topCenter.addChild(new Text2('LATE FOR CHRISTMAS', {' Line Number: 64
User prompt
if santa misses three presents is game over. a message appears with the message LATE FOR CHRISTMAS under message the score: (current score ) under the score the highscore: under the hichscore a button saying try again
User prompt
top left corner tree hearts. if santa misses a gift he loses one
User prompt
the score font is bold and looks like pixelated
User prompt
the number is pixelated and bold
User prompt
The number is bold
User prompt
top middle a score counter showing only a number. The number represents the amount of gifts collected
User prompt
reduce the present spawn rate
User prompt
the presents fall down
Initial prompt
Santa Panic
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.move = function () {}; self.collect = function () {}; }); var Gift = Container.expand(function () { var self = Container.call(this); var giftGraphics = self.createAsset('gift', 'Gift item', .5, .5); self.drop = function () { self.y += 5; }; }); var Game = Container.expand(function () { var self = Container.call(this); var score = 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 gifts = []; santa.x = 2048 / 2; santa.y = 2732 - santa.height; var giftCreationInterval = LK.setInterval(function () { var gift = new Gift(); gift.x = Math.random() * 2048; gift.y = 0; gifts.push(gift); self.addChild(gift); }, 2000); LK.on('tick', function () { santa.move(); for (var i = 0; i < gifts.length; i++) { gifts[i].drop(); if (santa.intersects(gifts[i])) { santa.collect(gifts[i]); score++; scoreTxt.setText(score.toString()); gifts[i].destroy(); gifts.splice(i, 1); i--; } else if (gifts[i].y > 2732) { gifts[i].destroy(); gifts.splice(i, 1); i--; if (--lives <= 0) { LK.showGameOver(); var lateForChristmasText = new Text2('LATE FOR CHRISTMAS', { size: 150, fill: '#ffffff' }); lateForChristmasText.x = 2048 / 2; lateForChristmasText.y = 2732 / 2 - 300; lateForChristmasText.anchor.set(0.5, 0.5); LK.gui.topCenter.addChild(lateForChristmasText); var scoreText = new Text2('Score: ' + score, { size: 120, fill: '#ffffff' }); scoreText.x = 2048 / 2; scoreText.y = 2732 / 2 - 150; scoreText.anchor.set(0.5, 0.5); LK.gui.topCenter.addChild(scoreText); var highscore = Math.max(score, parseInt(localStorage.getItem('highscore') || '0')); localStorage.setItem('highscore', highscore.toString()); LK.gui.topCenter.addChild(new Text2('Highscore: ' + highscore, { size: 120, fill: '#ffffff' }).set({ x: 2048 / 2, y: 2732 / 2 }).anchor.set(0.5, 0.5)); var tryAgainButton = new Text2('Try Again', { size: 100, fill: '#ffffff' }).setInteractive(true).set({ x: 2048 / 2, y: 2732 / 2 + 150 }).anchor.set(0.5, 0.5); tryAgainButton.on('down', function () { LK.resetGame(); }); LK.gui.topCenter.addChild(tryAgainButton); } } } }); stage.on('down', function (obj) { var pos = obj.event.getLocalPosition(self); santa.x = pos.x; }); stage.on('move', function (obj) { var pos = obj.event.getLocalPosition(self); santa.x = pos.x; }); });
===================================================================
--- original.js
+++ change.js
@@ -72,12 +72,11 @@
var scoreText = new Text2('Score: ' + score, {
size: 120,
fill: '#ffffff'
});
- scoreText.set({
- x: 2048 / 2,
- y: 2732 / 2 - 150
- }).anchor.set(0.5, 0.5);
+ scoreText.x = 2048 / 2;
+ scoreText.y = 2732 / 2 - 150;
+ scoreText.anchor.set(0.5, 0.5);
LK.gui.topCenter.addChild(scoreText);
var highscore = Math.max(score, parseInt(localStorage.getItem('highscore') || '0'));
localStorage.setItem('highscore', highscore.toString());
LK.gui.topCenter.addChild(new Text2('Highscore: ' + highscore, {
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.