User prompt
arkaplan oluştur
User prompt
atış hakkı 3 saniyede bir tekrar 10 olsun
User prompt
sol altta atış hakkımız yazsın
User prompt
5 yerine 3 saniye olsun
User prompt
5 saniyede 10 dan fazla atış yapılırsa turret 3 saniye ateş edemesin
User prompt
arkaplan oluştur
User prompt
arkaplan oluştur
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'scoreText.style.fill = 0x0000FF; // Change score text color to blue' Line Number: 283
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'scoreText.style.fill = 0xFFFFFF; // Revert score text color to white' Line Number: 283
User prompt
Küre bizde aktifken puan tablomuzun rengi mavi olsun
User prompt
küre bize değince üzerimizde küre oluşsun ve 10 saniye boyunca bize değen zombiler bize hasar veremesin
/**** * Classes ****/ var Bullet = Container.expand(function (startX, startY, targetX, targetY) { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.x = startX; self.y = startY; var speed = 10; var angle = Math.atan2(targetY - startY, targetX - startX); self.vx = Math.cos(angle) * speed; self.vy = Math.sin(angle) * speed; self.update = function () { self.x += self.vx; self.y += self.vy; if (self.x < 0 || self.x > 2048 || self.y < 0 || self.y > 2732) { self.destroy(); } }; }); var Heart = Container.expand(function () { var self = Container.call(this); var heartGraphics = self.attachAsset('heart', { anchorX: 0.5, anchorY: 0.5 }); self.spawnHeart(); var speed = 3; self.update = function () { var angle = Math.atan2(turret.y - self.y, turret.x - self.x); self.x += Math.cos(angle) * speed; self.y += Math.sin(angle) * speed; if (self.intersects(turret)) { lives++; livesText.setText(lives.toString()); self.destroy(); hearts.splice(hearts.indexOf(self), 1); } }; }); var Tabut = Container.expand(function () { var self = Container.call(this); var zombieGraphics = self.attachAsset('zombie2', { anchorX: 0.5, anchorY: 0.5 }); self.spawnZombie(); var speed = 2; self.update = function () { var angle = Math.atan2(turret.y - self.y, turret.x - self.x); self.x += Math.cos(angle) * speed; self.y += Math.sin(angle) * speed; if (self.intersects(turret)) { LK.effects.flashScreen(0xff0000, 1000); self.destroy(); zombies.splice(zombies.indexOf(self), 1); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } }; }); //<Write imports for supported plugins here> //<Write entity 'classes' with empty functions for important behavior here> var Turret = Container.expand(function () { var self = Container.call(this); var turretGraphics = self.attachAsset('turret', { anchorX: 0.5, anchorY: 0.5 }); self.shoot = function (targetX, targetY) { if (!turretDisabled && shotsRemaining > 0) { var currentTime = Date.now(); fireTimestamps.push(currentTime); // Remove timestamps older than 3 seconds fireTimestamps = fireTimestamps.filter(function (timestamp) { return currentTime - timestamp <= 3000; }); if (fireTimestamps.length > 10) { turretDisabled = true; LK.setTimeout(function () { turretDisabled = false; }, 3000); // Disable turret for 3 seconds } else { shotsRemaining--; shotsText.setText(shotsRemaining.toString()); var bullet = new Bullet(self.x, self.y, targetX, targetY); game.addChild(bullet); bullets.push(bullet); } } }; }); var Zombie = Container.expand(function () { var self = Container.call(this); var zombieGraphics = self.attachAsset('zombie', { anchorX: 0.5, anchorY: 0.5 }); self.spawnZombie(); var speed = 2; self.update = function () { var angle = Math.atan2(turret.y - self.y, turret.x - self.x); self.x += Math.cos(angle) * speed; self.y += Math.sin(angle) * speed; if (self.intersects(turret)) { LK.effects.flashScreen(0xff0000, 1000); self.destroy(); zombies.splice(zombies.indexOf(self), 1); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } }; }); var Zombie3 = Container.expand(function () { var self = Container.call(this); var zombieGraphics = self.attachAsset('zombie3', { anchorX: 0.5, anchorY: 0.5 }); self.spawnZombie(); var speed = 4; self.update = function () { var angle = Math.atan2(turret.y - self.y, turret.x - self.x); self.x += Math.cos(angle) * speed; self.y += Math.sin(angle) * speed; if (self.intersects(turret)) { LK.effects.flashScreen(0xff0000, 1000); self.destroy(); zombies.splice(zombies.indexOf(self), 1); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var shotsRemaining = 10; // Initialize shots remaining LK.setInterval(function () { shotsRemaining = 10; shotsText.setText(shotsRemaining.toString()); }, 3000); // Reset shots every 3 seconds var shotsText = new Text2(shotsRemaining.toString(), { size: 150, fill: 0xFFFFFF }); shotsText.anchor.set(0, 1); LK.gui.bottomLeft.addChild(shotsText); var zombies = []; // Initialize zombies array // Double the number of zombies spawned for (var i = 0; i < zombies.length; i++) { var newZombie = new Zombie(); newZombie.x = zombies[i].x; newZombie.y = zombies[i].y; game.addChild(newZombie); zombies.push(newZombie); } // Increase zombie speed by 100% //<Assets used in the game will automatically appear here> var background = LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5, scaleX: 2048 / 100, scaleY: 2732 / 100, x: 2048 / 2, y: 2732 / 2 }); game.addChild(background); background.zIndex = -1; // Ensure background is behind other elements Heart.prototype.spawnHeart = function () { this.x = Math.random() * 2048; this.y = Math.random() * 2732; }; Zombie.prototype.spawnZombie = Tabut.prototype.spawnZombie = Zombie3.prototype.spawnZombie = function () { var side = Math.floor(Math.random() * 4); switch (side) { case 0: // top this.x = Math.random() * 2048; this.y = -181.78; break; case 1: // right this.x = 2048 + 120; this.y = Math.random() * 2732; break; case 2: // bottom this.x = Math.random() * 2048; this.y = 2732 + 181.78; break; case 3: // left this.x = -120; this.y = Math.random() * 2732; break; } }; var turret = game.addChild(new Turret()); turret.x = 2048 / 2; turret.y = 2732 / 2; var bullets = []; var fireTimestamps = []; // Track timestamps of each shot var turretDisabled = false; // Track if turret is disabled var zombies = []; // Initialize zombies array var hearts = []; game.down = function (x, y, obj) { turret.shoot(x, y); }; var score = 0; var lives = 3; var livesText = new Text2(lives.toString(), { size: 150, fill: 0xFFFFFF }); livesText.anchor.set(1, 0); LK.gui.topRight.addChild(livesText); var scoreText = new Text2(score.toString(), { size: 150, fill: 0xFFFFFF }); scoreText.anchor.set(0.5, 0); LK.gui.top.addChild(scoreText); game.update = function () { for (var i = bullets.length - 1; i >= 0; i--) { bullets[i].update(); for (var j = zombies.length - 1; j >= 0; j--) { if (bullets[i].intersects(zombies[j])) { bullets[i].destroy(); bullets.splice(i, 1); if (zombies[j] instanceof Tabut) { var newZombie1 = new Zombie(); newZombie1.x = zombies[j].x; newZombie1.y = zombies[j].y; game.addChild(newZombie1); zombies.push(newZombie1); var newZombie2 = new Zombie(); newZombie2.x = zombies[j].x + 60; // Spawn the second zombie slightly to the right newZombie2.y = zombies[j].y; game.addChild(newZombie2); zombies.push(newZombie2); } else if (zombies[j] instanceof Zombie3) { score += 10; scoreText.setText(score.toString()); } else { score += 5; scoreText.setText(score.toString()); } // Play a random zombie sound var zombieSound = 'zombie' + Math.ceil(Math.random() * 3); LK.getSound(zombieSound).play(); zombies[j].destroy(); zombies.splice(j, 1); break; } } } for (var k = zombies.length - 1; k >= 0; k--) { zombies[k].update(); for (var h = hearts.length - 1; h >= 0; h--) { var angle = Math.atan2(hearts[h].y - zombies[k].y, hearts[h].x - zombies[k].x); zombies[k].x += Math.cos(angle) * 2; // Zombies move towards the heart zombies[k].y += Math.sin(angle) * 2; if (zombies[k].intersects(hearts[h])) { hearts[h].destroy(); hearts.splice(h, 1); } } } if (LK.ticks % 60 == 0) { var newZombie = new Zombie(); game.addChild(newZombie); zombies.push(newZombie); } if (score >= 25 && LK.ticks % 480 == 0) { var newTabut = new Tabut(); game.addChild(newTabut); zombies.push(newTabut); } if (score >= 100 && LK.ticks % 420 == 0) { var newZombie3 = new Zombie3(); game.addChild(newZombie3); zombies.push(newZombie3); } if (LK.ticks % 3600 == 0) { var newHeart = new Heart(); game.addChild(newHeart); hearts.push(newHeart); // Increase zombie speed by 60% zombies.forEach(function (zombie) { zombie.speed *= 2.0; }); } };
===================================================================
--- original.js
+++ change.js
@@ -185,8 +185,9 @@
x: 2048 / 2,
y: 2732 / 2
});
game.addChild(background);
+background.zIndex = -1; // Ensure background is behind other elements
Heart.prototype.spawnHeart = function () {
this.x = Math.random() * 2048;
this.y = Math.random() * 2732;
};
turret. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows. less futuristic orange and silver colored shoots normal bullets two rifles
tekerlekli animasyon bir tabut ve dikey pozisyonda. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
ayakları olan animasyon bir kalp. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.