Code edit (1 edits merged)
Please save this source code
User prompt
Noel baba oyunu yazsini kaldir
User prompt
Fix bug
User prompt
Coin collect sesini kutu topladigimizde çal
User prompt
Kutu topladigimizda cikacak bir ses ekle mario altin sesine benzesin
User prompt
Oyun çok kasıyor oyunu optimize et ve oyun full ekran olsun
User prompt
Score ve hight score yazisinin fontunu kalinlastir ana menüyü tamam en kaldır kaybedince ortada kalin yazi fontlu TEKRAR OYNA yazisi gozuksun arkasindada dikdortgen kenarlari yumusaklastirilmis bir cslisim koy score ve hight score oyun devam eder ken gozukmesin tekrar oyna yazisinin ustunde gozuksun sadece
User prompt
Altini tam orta en uste koy okunabilur olsun ve ana ekrandaki yazilari buyut yazilarin fontunu kalinlaştir ,
User prompt
Ana menüdeyken kutular gelmesin beklesin oynaya bastigimizda gelsinler ve her oyubda rastgele gelsinler , ana menüdei oyna yı bir butzn gibi dikdortgen kenarli bir cismin icine koy daha onabilir olsun ve altin sayisi ve hight scorede daha okunur olsun arkasinds bir cisim gib bir pixelart bisey olsun oyunla alakali ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyinu bir ana menü ekle menüde Oyna , Hight Score , Altin sayisi olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Hight score kaybedince sıfırlanmasın sadece hught scoreden daha fazla score yaparsak yeni scoremiz hight score olarak duzenlensin her hwdiye kurltusu topladigimizda 1 altin eklensin ve altinlar asla sifirlanmasin silinmesin topladigimiz altinlar kaybedip tekrar oynamaya baslasak bile durmaya devam etsin ve atin gorselini ve sayisini cok az bisey sola dogru getir ve hediye kutulari assagiya dovru inerken titremesin ve daha hizli insin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'currentSkin is not defined' in or related to this line: 'var santa = game.addChild(new Santa(currentSkin));' Line Number: 144
User prompt
Skinleti kaldir.markwti kaldir oyunu fixle
User prompt
Oyunda altinlarimizi harcaya bilecegimiz bir market olustur markete de 3 tane noel baba skini ekle ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Altin sayisini sağ üst köşeye koy ve bir altın gorseliyle beraber guzel bir altin sayisi yap
User prompt
Oyunda her hediye kutusu topladigimizda 1 altın kazanalım ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyuna tekrar oyna gibi seylerin oldugu bir arayyz ekle
User prompt
Hediyeler cok daha hizli gelsin ve bir scoreboard ekle
User prompt
Hediyeler daha hizli gelsin
User prompt
Migrate to the latest version of LK
Remix started
Copy Santa Panic
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Gift = Container.expand(function (dropSpeed) { var self = Container.call(this); self.dropSpeed = dropSpeed; var giftGraphics = self.attachAsset('gift', { anchorX: 0.5, anchorY: 0.5 }); self.drop = function () { self.y += self.dropSpeed * 1.5; }; }); var GrayHeart = Container.expand(function () { var self = Container.call(this); var grayHeartGraphics = self.attachAsset('grayHeart', {}); }); var Ground = Container.expand(function () { var self = Container.call(this); var groundGraphics = self.attachAsset('ground', { anchorY: 1 }); groundGraphics.width = 2048; self.addChild(groundGraphics); }); var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.attachAsset('heart', {}); }); var Santa = Container.expand(function () { var self = Container.call(this); var santaGraphics = self.attachAsset('santa', { anchorX: 0.5, anchorY: 0.5 }); self.lastX = self.x; self._move_migrated = function (newX) { var halfWidth = this.width / 2; var oldX = this.x; var moveAmount = Math.max(halfWidth, Math.min(2048 - halfWidth, newX)) - this.x; this.x += moveAmount * 0.2; if (oldX > this.x) { this.scale.x = 1; } else if (oldX < this.x) { this.scale.x = -1; } self.lastX = this.x; }; self.collect = function () {}; return self; }); var Snowflake = Container.expand(function (santa) { var self = Container.call(this); self.santa = santa; var snowflakeGraphics = self.attachAsset('snowflake', { anchorX: 0.5, anchorY: 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(); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000, fullscreen: true }); /**** * Game Code ****/ var gameState = 'menu'; // 'menu' or 'playing' var score = 0; var highestScore = storage.highestScore || 0; var goldCoins = storage.goldCoins || 0; var scoreTxt = new Text2(score.toString(), { size: 150, fill: 0xFFFFFF, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); scoreTxt.anchor.set(.5, 0); scoreTxt.visible = false; LK.gui.top.addChild(scoreTxt); // Main Menu UI var menuTitle = new Text2('NOEL BABA OYUNU', { size: 150, fill: 0xFFD700, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); menuTitle.anchor.set(0.5, 0.5); menuTitle.x = 2048 / 2; menuTitle.y = 2732 / 2 - 300; game.addChild(menuTitle); var playButtonBg = LK.getAsset('buttonBg', { anchorX: 0.5, anchorY: 0.5 }); playButtonBg.x = 2048 / 2; playButtonBg.y = 2732 / 2 - 100; game.addChild(playButtonBg); var playButton = new Text2('OYNA', { size: 120, fill: 0xFFFFFF, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); playButton.anchor.set(0.5, 0.5); playButton.x = 2048 / 2; playButton.y = 2732 / 2 - 100; game.addChild(playButton); var highScoreBg = LK.getAsset('scoreBg', { anchorX: 0.5, anchorY: 0.5 }); highScoreBg.x = 2048 / 2; highScoreBg.y = 2732 / 2; game.addChild(highScoreBg); var highScoreButton = new Text2('HIGH SCORE: ' + highestScore.toString(), { size: 100, fill: 0xFFD700, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); highScoreButton.anchor.set(0.5, 0.5); highScoreButton.x = 2048 / 2; highScoreButton.y = 2732 / 2; game.addChild(highScoreButton); var goldButtonBg = LK.getAsset('scoreBg', { anchorX: 0.5, anchorY: 0.5 }); goldButtonBg.x = 2048 / 2; goldButtonBg.y = 2732 / 2 + 100; game.addChild(goldButtonBg); var goldButton = new Text2('ALTIN: ' + goldCoins.toString(), { size: 100, fill: 0xFFD700, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); goldButton.anchor.set(0.5, 0.5); goldButton.x = 2048 / 2; goldButton.y = 2732 / 2 + 100; game.addChild(goldButton); var highScoreTxt = new Text2('High Score: ' + highestScore.toString(), { size: 80, fill: 0xFFD700, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); highScoreTxt.anchor.set(.5, 0); highScoreTxt.y = 160; highScoreTxt.visible = false; LK.gui.top.addChild(highScoreTxt); var goldIcon = LK.getAsset('goldCoin', { anchorX: 0.5, anchorY: 0.5 }); goldIcon.x = -40; goldIcon.y = 50; goldIcon.visible = false; LK.gui.top.addChild(goldIcon); var goldTxt = new Text2(goldCoins.toString(), { size: 80, fill: 0xFFD700 }); goldTxt.anchor.set(0, 0.5); goldTxt.x = 10; goldTxt.y = 50; goldTxt.visible = false; LK.gui.top.addChild(goldTxt); 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; heart.visible = false; hearts.push(heart); LK.gui.topLeft.addChild(heart); } var santa = game.addChild(new Santa()); santa.visible = false; // Add click handler for play button playButton.down = function () { startGame(); }; // Add click handler for play button background playButtonBg.down = function () { startGame(); }; // Function to start the game function startGame() { gameState = 'playing'; // Hide menu elements menuTitle.visible = false; playButtonBg.visible = false; playButton.visible = false; highScoreBg.visible = false; highScoreButton.visible = false; goldButtonBg.visible = false; goldButton.visible = false; // Show game UI elements (but not score/high score during gameplay) goldIcon.visible = true; goldTxt.visible = true; santa.visible = true; // Show hearts for (var i = 0; i < hearts.length; i++) { hearts[i].visible = true; } } var snowflakes = []; for (var i = 0; i < 5; i++) { var initialSnowflake = new Snowflake(santa); initialSnowflake.x = Math.random() * 2048; initialSnowflake.y = Math.random() * 2732; snowflakes.push(initialSnowflake); game.addChild(initialSnowflake); } var snowfallInterval = LK.setInterval(function () { if (snowflakes.length < 8) { var snowflake = new Snowflake(santa); snowflake.x = 2048 + snowflake.width / 2; snowflake.y = Math.random() * 2732; snowflakes.push(snowflake); game.addChild(snowflake); } }, 2000); var gifts = []; santa.x = 2048 / 2; santa.y = 2732 - santa.height; var ground = new Ground(); var background = game.attachAsset('background', {}); background.width = 2048; background.height = 2732 - ground.height; game.addChildAt(background, 0); game.addChildAt(ground, 1); var giftDropSpeed = 20; var maxGiftDropSpeed = 40; var giftSpeedIncreaseInterval = 10000; var lastSpeedIncreaseTime = 0; var giftCreationInterval = LK.setInterval(function () { if (gameState !== 'playing') return; 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 = -250; gifts.push(gift); game.addChild(gift); }, 2000); LK.on('tick', function () { if (gameState !== 'playing') return; santa._move_migrated(); for (var j = snowflakes.length - 1; j >= 0; j--) { snowflakes[j].drop(); if (snowflakes[j].y > 2732 || snowflakes[j].x < -snowflakes[j].width) { snowflakes[j].destroy(); snowflakes.splice(j, 1); } } for (var i = 0; i < gifts.length; i++) { gifts[i].drop(); if (santa.intersects(gifts[i])) { LK.getSound('coinCollect').play(); santa.collect(gifts[i]); score++; goldCoins++; storage.goldCoins = goldCoins; if (score > highestScore) { highestScore = score; storage.highestScore = highestScore; } scoreTxt.setText('Score: ' + score.toString()); highScoreTxt.setText('High Score: ' + highestScore.toString()); goldTxt.setText(goldCoins.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); } // Create restart button background var restartButtonBg = LK.getAsset('restartButtonBg', { anchorX: 0.5, anchorY: 0.5 }); restartButtonBg.x = 2048 / 2; restartButtonBg.y = 2732 / 2 + 200; game.addChild(restartButtonBg); // Create restart button var restartButton = new Text2('TEKRAR OYNA', { size: 100, fill: 0xFFFFFF, font: "'GillSans-Bold',Impact,'Arial Black',Tahoma" }); restartButton.anchor.set(0.5, 0.5); restartButton.x = 2048 / 2; restartButton.y = 2732 / 2 + 200; game.addChild(restartButton); // Show score and high score above restart button scoreTxt.setText('Score: ' + score.toString()); scoreTxt.x = 2048 / 2; scoreTxt.y = 2732 / 2 + 50; scoreTxt.visible = true; highScoreTxt.setText('High Score: ' + highestScore.toString()); highScoreTxt.x = 2048 / 2; highScoreTxt.y = 2732 / 2 + 120; highScoreTxt.visible = true; // Add click handler for restart button background restartButtonBg.down = function () { // Reset game state score = 0; lives = 3; giftDropSpeed = 20; lastSpeedIncreaseTime = 0; // Clear existing objects for (var g = 0; g < gifts.length; g++) { gifts[g].destroy(); } gifts = []; for (var s = 0; s < snowflakes.length; s++) { snowflakes[s].destroy(); } snowflakes = []; // Reset hearts for (var h = 0; h < hearts.length; h++) { hearts[h].destroy(); } hearts = []; // Recreate 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); } // Reset santa position santa.x = 2048 / 2; santa.y = 2732 - santa.height; // Update UI goldTxt.setText(goldCoins.toString()); // Remove restart button and background restartButton.destroy(); restartButtonBg.destroy(); // Recreate snowflakes for (var i = 0; i < 5; i++) { var initialSnowflake = new Snowflake(santa); initialSnowflake.x = Math.random() * 2048; initialSnowflake.y = Math.random() * 2732; snowflakes.push(initialSnowflake); game.addChild(initialSnowflake); } // Restart game function function restartGame() { // Reset game state score = 0; lives = 3; giftDropSpeed = 20; lastSpeedIncreaseTime = 0; // Clear existing objects for (var g = 0; g < gifts.length; g++) { gifts[g].destroy(); } gifts = []; for (var s = 0; s < snowflakes.length; s++) { snowflakes[s].destroy(); } snowflakes = []; // Reset hearts for (var h = 0; h < hearts.length; h++) { hearts[h].destroy(); } hearts = []; // Recreate 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); } // Reset santa position santa.x = 2048 / 2; santa.y = 2732 - santa.height; // Update UI goldTxt.setText(goldCoins.toString()); // Recreate snowflakes for (var i = 0; i < 5; i++) { var initialSnowflake = new Snowflake(santa); initialSnowflake.x = Math.random() * 2048; initialSnowflake.y = Math.random() * 2732; snowflakes.push(initialSnowflake); game.addChild(initialSnowflake); } // Reset to menu gameState = 'menu'; menuTitle.visible = true; playButtonBg.visible = true; playButton.visible = true; highScoreBg.visible = true; highScoreButton.setText('HIGH SCORE: ' + highestScore.toString()); highScoreButton.visible = true; goldButtonBg.visible = true; goldButton.setText('ALTIN: ' + goldCoins.toString()); goldButton.visible = true; // Hide game UI scoreTxt.visible = false; highScoreTxt.visible = false; goldIcon.visible = false; goldTxt.visible = false; santa.visible = false; // Hide hearts for (var i = 0; i < hearts.length; i++) { hearts[i].visible = false; } } // Reset to menu gameState = 'menu'; menuTitle.visible = true; playButtonBg.visible = true; playButton.visible = true; highScoreBg.visible = true; highScoreButton.setText('HIGH SCORE: ' + highestScore.toString()); highScoreButton.visible = true; goldButtonBg.visible = true; goldButton.setText('ALTIN: ' + goldCoins.toString()); goldButton.visible = true; // Hide game UI scoreTxt.visible = false; highScoreTxt.visible = false; goldIcon.visible = false; goldTxt.visible = false; santa.visible = false; // Hide hearts for (var i = 0; i < hearts.length; i++) { hearts[i].visible = false; } }; // Add click handler for restart restartButton.down = function () { restartGame(); }; 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); } } } }); game.on('down', function (x, y, obj) { if (gameState === 'playing') { var pos = game.toLocal(obj.global); santa._move_migrated(pos.x); } }); game.on('move', function (x, y, obj) { if (gameState === 'playing') { var pos = game.toLocal(obj.global); santa._move_migrated(pos.x); } });
===================================================================
--- original.js
+++ change.js
@@ -274,8 +274,9 @@
}
for (var i = 0; i < gifts.length; i++) {
gifts[i].drop();
if (santa.intersects(gifts[i])) {
+ LK.getSound('coinCollect').play();
santa.collect(gifts[i]);
score++;
goldCoins++;
storage.goldCoins = goldCoins;
@@ -285,9 +286,8 @@
}
scoreTxt.setText('Score: ' + score.toString());
highScoreTxt.setText('High Score: ' + highestScore.toString());
goldTxt.setText(goldCoins.toString());
- LK.getSound('coinCollect').play();
gifts[i].destroy();
gifts.splice(i, 1);
i--;
if (hearts.length > 0) {
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.
Gold money 2d pixelart. In-Game asset. 2d. High contrast. No shadows
Yuvarlak kenarli dikdortgen. In-Game asset. 2d. High contrast. No shadows