User prompt
bir yazi ekle text game overin uzerine ve yazi getor yazilsin
Code edit (1 edits merged)
Please save this source code
User prompt
if (player.intersects(enemy)) { LK.showGameOver(); LK.getSound('gamop').play(); if (score > highScore) { highScore = score; } scoreText.setText('Score: ' + score + '\nHigh Score: ' + highScore); scoreText.x = 2048 / 2; scoreText.y = 2732 / 2 + 200; // Ekranın ortasında göstermek için }
User prompt
game.down = function (x, y, obj) { player.jump(); for (var i = 0; i < enemies.length; i++) { var enemy = enemies[i]; var passedEnemy = player.y < enemy.y && player.x > enemy.x && player.x < enemy.x + enemy.width; if (passedEnemy) { score++; scoreText.setText('Score: ' + score); break; } } }; bunu ekle bakalim
User prompt
Honey, listen to me carefully. In games like Subway Surf or other games like Flabbybird etc., when we come to the Gameover screen, our score is shown. Please do that, do it properly.
User prompt
bu oyuna skor ekle artik
User prompt
ilk bastaki skor sistemin geri koy yerine
User prompt
halada gozukuyor duzmanin uzerinden her zipladimizda scoremiz 1 kere artsin
User prompt
benim oyunuma koymani istedim ama koymuyorsun bu oyuna koy o sistemi
User prompt
halada gozukmuyor
User prompt
skorumuz game overin altinde gozuksun
User prompt
hight score ekle ya
User prompt
scoremiz her dusmanin uzerinden atladimizda 1 artsin tm mi
User prompt
scor koy oyuna oyun bitdinde skorumuz gozyuksun mesala score=1
User prompt
kirmiz renkde textle yazilsiz skorumuzu
User prompt
halada gozukmuyo skorumuz text seklinde gozuksun olay again tusunun uzerinde
User prompt
onu bos ver skorumuz game over ekraninda gozuksun kac tane ennemyin uzerinden zepladik gozuksun
User prompt
dusmanlar bize deydiyiyinde gamop sesi calsin
User prompt
game over ekrani geldiyinde calsin
User prompt
didi muziyini oyuna koy sonsuz devam etsin
User prompt
ekranda gozuksun yada game over ekraninda
User prompt
hey score sayacin eklememisin scoremiz gorunmuyo
User prompt
Let's have a score counter, put a text under the pause button, score = 0 and every time we jump over the smoke, the 0 in our score will become +1 and it will appear.
User prompt
ve bu game over ekraninda play again tusunun uzerinde scorumuz gozukucek
User prompt
enemmyler playere deydinde game over ekranina aticak
/**** * Classes ****/ // Define a class for enemies var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; }; }); //<Assets used in the game will automatically appear here> // Define a class for the player character var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { // Apply gravity self.velocityY += 0.8; self.y += self.velocityY; // Prevent the player from falling below the ground if (self.y > ground.y - self.height) { self.y = ground.y - self.height; self.velocityY = 0; self.isJumping = false; } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB, // Sky blue background width: 8192, height: 10928 }); /**** * Game Code ****/ var background = game.addChild(LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5, width: game.width, height: game.height })); background.x = game.width / 2; background.y = game.height / 2; // Play the music in a loop LK.playMusic('didi', { loop: true }); // Create a ground asset and add it to the game var ground = game.addChild(LK.getAsset('ground', { anchorX: 0, anchorY: 1 })); ground.x = 0; ground.y = 2732 - 300; // Move the ground a bit upwards // Initialize player var player = game.addChild(new Player()); player.x = 2048 / 2; player.y = ground.y - player.height - 420; // Initialize enemies var enemies = []; var enemySpawnInterval = 100; var enemySpawnCounter = 0; // Create a new Text2 object to display the score var scoreText = new Text2('0', { size: 100, fill: 0xFFFFFF }); // Add the score text to the game GUI under the pause button LK.gui.top.addChild(scoreText); scoreText.x = 2048 / 2; scoreText.y = 100; // Initialize score var score = 0; // Handle game updates game.update = function () { player.update(); // Spawn enemies enemySpawnCounter++; if (enemySpawnCounter >= enemySpawnInterval) { var enemy = new Enemy(); // Set the spawn position for the enemy to be the same as the ground's y position enemy.x = game.width; enemy.y = ground.y - enemy.height; enemies.push(enemy); game.addChild(enemy); // Randomize the spawn interval for the next enemy enemySpawnInterval = Math.floor(Math.random() * 150) + 50; enemySpawnCounter = 0; } // Update enemies for (var i = 0; i < enemies.length; i++) { var enemy = enemies[i]; enemy.update(); // Check if player intersects with enemy if (player.intersects(enemy)) { // Show game over screen LK.showGameOver(); // Play the 'gamop' sound LK.getSound('gamop').play(); // Show score on game over screen LK.gui.top.addChild(scoreText); scoreText.x = 2048 / 2; scoreText.y = 0; scoreText.setText('Score: ' + score); } } // Update the score text scoreText.setText('Score: ' + score); }; // Handle player jump game.down = function (x, y, obj) { player.jump(); // Increase score by 1 score++; };
===================================================================
--- original.js
+++ change.js
@@ -118,12 +118,10 @@
// Check if player intersects with enemy
if (player.intersects(enemy)) {
// Show game over screen
LK.showGameOver();
- // Play the music
- LK.playMusic('didi', {
- loop: true
- });
+ // Play the 'gamop' sound
+ LK.getSound('gamop').play();
// Show score on game over screen
LK.gui.top.addChild(scoreText);
scoreText.x = 2048 / 2;
scoreText.y = 0;
guzel 2d bir arka plan bulutlu havalar arkada ucan kuslar ve bu 2d olucak. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. 2d
yuzu olan kizqin bir ates topu sinirli yakici ve pixelart. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows