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; 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 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 () {}; }); 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 }); /**** * Game Code ****/ var score = 0; var highestScore = 0; var goldCoins = storage.goldCoins || 0; var scoreTxt = new Text2(score.toString(), { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(.5, 0); LK.gui.top.addChild(scoreTxt); var highScoreTxt = new Text2('High Score: ' + highestScore.toString(), { size: 80, fill: 0xFFD700 }); highScoreTxt.anchor.set(.5, 0); highScoreTxt.y = 160; LK.gui.top.addChild(highScoreTxt); var goldTxt = new Text2('Gold: ' + goldCoins.toString(), { size: 80, fill: 0xFFD700 }); goldTxt.anchor.set(.5, 0); goldTxt.y = 240; 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; hearts.push(heart); LK.gui.topLeft.addChild(heart); } var santa = game.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); game.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); game.addChild(snowflake); } }, 1000); 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 () { 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); game.addChild(gift); }, 2000); LK.on('tick', function () { santa._move_migrated(); 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++; goldCoins++; storage.goldCoins = goldCoins; if (score > highestScore) { highestScore = score; } scoreTxt.setText('Score: ' + score.toString()); highScoreTxt.setText('High Score: ' + highestScore.toString()); goldTxt.setText('Gold: ' + 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); } scoreTxt.setText('Highest Score: ' + highestScore.toString()); // Create restart button var restartButton = new Text2('TEKRAR OYNA', { size: 100, fill: 0xFFFFFF }); restartButton.anchor.set(0.5, 0.5); restartButton.x = 2048 / 2; restartButton.y = 2732 / 2 + 200; game.addChild(restartButton); // Add click handler for restart restartButton.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 scoreTxt.setText('Score: ' + score.toString()); highScoreTxt.setText('High Score: ' + highestScore.toString()); goldTxt.setText('Gold: ' + goldCoins.toString()); // Remove restart button restartButton.destroy(); // Recreate 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); game.addChild(initialSnowflake); } }; 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) { var pos = game.toLocal(obj.global); santa._move_migrated(pos.x); }); game.on('move', function (x, y, obj) { var pos = game.toLocal(obj.global); santa._move_migrated(pos.x); });
===================================================================
--- original.js
+++ change.js
@@ -1,5 +1,10 @@
/****
+* Plugins
+****/
+var storage = LK.import("@upit/storage.v1");
+
+/****
* Classes
****/
var Gift = Container.expand(function (dropSpeed) {
var self = Container.call(this);
@@ -80,8 +85,9 @@
* Game Code
****/
var score = 0;
var highestScore = 0;
+var goldCoins = storage.goldCoins || 0;
var scoreTxt = new Text2(score.toString(), {
size: 150,
fill: 0xFFFFFF
});
@@ -93,8 +99,15 @@
});
highScoreTxt.anchor.set(.5, 0);
highScoreTxt.y = 160;
LK.gui.top.addChild(highScoreTxt);
+var goldTxt = new Text2('Gold: ' + goldCoins.toString(), {
+ size: 80,
+ fill: 0xFFD700
+});
+goldTxt.anchor.set(.5, 0);
+goldTxt.y = 240;
+LK.gui.top.addChild(goldTxt);
var lives = 3;
var hearts = [];
for (var i = 0; i < lives; i++) {
var heart = new Heart();
@@ -159,13 +172,16 @@
gifts[i].drop();
if (santa.intersects(gifts[i])) {
santa.collect(gifts[i]);
score++;
+ goldCoins++;
+ storage.goldCoins = goldCoins;
if (score > highestScore) {
highestScore = score;
}
scoreTxt.setText('Score: ' + score.toString());
highScoreTxt.setText('High Score: ' + highestScore.toString());
+ goldTxt.setText('Gold: ' + goldCoins.toString());
gifts[i].destroy();
gifts.splice(i, 1);
i--;
if (hearts.length > 0) {
@@ -228,8 +244,9 @@
santa.y = 2732 - santa.height;
// Update UI
scoreTxt.setText('Score: ' + score.toString());
highScoreTxt.setText('High Score: ' + highestScore.toString());
+ goldTxt.setText('Gold: ' + goldCoins.toString());
// Remove restart button
restartButton.destroy();
// Recreate snowflakes
for (var i = 0; i < 10; i++) {
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