User prompt
Game over ekranınında skoru göster skoru oyun içinde beyaz goster
User prompt
Skor tabelasını beyaz göster
User prompt
Skoru beyaz göster ve oyun bittiğinde oyun ekranında göster
User prompt
Skoru beyaz göster oyun bittiğinde de göster
User prompt
Skoru sola ekle kalbin oaraya ekleme
User prompt
Skor tableası ekle lütfen
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'speed')' in or related to this line: 'score += Math.floor(rockets[0].speed / 5);' Line Number: 117
User prompt
Sol üstte kalpleri gösterdiğin gibi skor tabelasın8 göster ve ve roketler hızlandıkça skor da hızlansım
User prompt
Roket bizim yanımıza geldiğinde ve geçtiğinde bize zarar vermesin
User prompt
Karakter rokete değince kabı azalsın
User prompt
Karakter rokete değince kalbi azalsın ama tam hareket ederken değerse bir şey olmas8n
User prompt
Please fix the bug: 'ReferenceError: dragNode is not defined' in or related to this line: 'if (rockets[i].intersects(hero) && !dragNode) {' Line Number: 98
User prompt
Biz tam hareket ederken rokete basarsak karaktere bir şey olmasın
User prompt
Skor tablosu nerede lütfen skor tablosu ekle
User prompt
Biz roketkerden kactıkça skor arttsın sol üstte kalsın ve roketler hızlansım
User prompt
Kalplerin arasını aç biraz
User prompt
Skoru oyuncuya göster lütfen
User prompt
Skor sol üstte belirsin skor:{skor}
User prompt
Skoru göster oyuncuya
User prompt
Bir de skor eklesen ve skor yukarıda dursa
User prompt
Her düsmana dedigimizde yukarıda duran kalpleri azalt
User prompt
Her rokete dediğimizde kalbimiz azalsın
Initial prompt
Please fix the bug: 'ReferenceError: livesTxt is not defined' in or related to this line: 'livesTxt.setText('Lives: ' + hero.lives);' Line Number: 92
/**** * Classes ****/ var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.attachAsset('heart', { anchorX: 0.5, anchorY: 0.5 }); }); //<Write imports for supported plugins here> //<Write entity 'classes' with empty functions for important behavior here> var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.attachAsset('hero', { anchorX: 0.5, anchorY: 0.5 }); self.lives = 3; self.update = function () { // Hero update logic if needed }; }); var Rocket = Container.expand(function () { var self = Container.call(this); var rocketGraphics = self.attachAsset('rocket', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ //<Assets used in the game will automatically appear here> //<Write game logic code here, including initializing arrays and variables> var hero = game.addChild(new Hero()); hero.x = 2048 / 2; hero.y = 2732 - 150; var rockets = []; var score = 0; var scoreTxt = new Text2('Score: ' + score, { size: 100, fill: 0xFFFFFF }); scoreTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(scoreTxt); var livesTxt = new Text2('Lives: 3', { size: 100, fill: 0xFFFFFF }); livesTxt.anchor.set(0.5, 0); LK.gui.top.addChild(livesTxt); var heart1 = game.addChild(new Heart()); heart1.x = 2048 - 150; heart1.y = 50; var heart2 = game.addChild(new Heart()); heart2.x = 2048 - 250; heart2.y = 50; var heart3 = game.addChild(new Heart()); heart3.x = 2048 - 350; heart3.y = 50; var dragNode = null; game.down = function (x, y, obj) { hero.x = x; dragNode = hero; }; game.update = function () { if (LK.ticks % (60 - Math.floor(score / 100)) == 0) { // Decrease the interval between rocket spawns as the score increases var newRocket = new Rocket(); newRocket.x = Math.random() * 2048; newRocket.y = -50; newRocket.speed += Math.floor(score / 100); // Increase the speed of rockets as the score increases rockets.push(newRocket); game.addChild(newRocket); } for (var i = rockets.length - 1; i >= 0; i--) { if (rockets[i].intersects(hero)) { hero.lives -= 1; livesTxt.setText('Lives: ' + hero.lives); rockets[i].destroy(); rockets.splice(i, 1); if (hero.lives == 2) { heart3.destroy(); } if (hero.lives == 1) { heart2.destroy(); } if (hero.lives <= 0) { heart1.destroy(); LK.showGameOver(); } } } score += 1; scoreTxt.setText('Score: ' + score); };
===================================================================
--- original.js
+++ change.js
@@ -89,9 +89,9 @@
rockets.push(newRocket);
game.addChild(newRocket);
}
for (var i = rockets.length - 1; i >= 0; i--) {
- if (rockets[i].intersects(hero) && !dragNode) {
+ if (rockets[i].intersects(hero)) {
hero.lives -= 1;
livesTxt.setText('Lives: ' + hero.lives);
rockets[i].destroy();
rockets.splice(i, 1);
Bildiğin roket yap. Bir tane Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Kalp yap. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Arkaplan olarak uzay yap. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
İnsan. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.