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 Sphere = Container.expand(function () { var self = Container.call(this); var sphereGraphics = self.attachAsset('sphere', { anchorX: 0.5, anchorY: 0.5 }); self.spawnSphere(); 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)) { self.destroy(); spheres.splice(spheres.indexOf(self), 1); turret.invincible = true; LK.setTimeout(function () { turret.invincible = false; }, 10000); // 10 seconds of invincibility } }; }); 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)) { if (!turret.invincible) { LK.effects.flashScreen(0xff0000, 1000); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } self.destroy(); zombies.splice(zombies.indexOf(self), 1); } }; }); //<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) { 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)) { if (!turret.invincible) { LK.effects.flashScreen(0xff0000, 1000); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } self.destroy(); zombies.splice(zombies.indexOf(self), 1); } }; }); 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)) { if (!turret.invincible) { LK.effects.flashScreen(0xff0000, 1000); lives--; livesText.setText(lives.toString()); if (lives <= 0) { LK.showGameOver(); } } self.destroy(); zombies.splice(zombies.indexOf(self), 1); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ Sphere.prototype.spawnSphere = function () { this.x = Math.random() * 2048; this.y = Math.random() * 2732; }; var zombies = []; // Initialize zombies array var spheres = []; // Initialize spheres 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> 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 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()); if (turret.invincible) { scoreText.setStyle({ fill: 0x0000FF }); // Change score text color to blue } else { scoreText.setStyle({ fill: 0xFFFFFF }); // Revert score text color to white } } else { score += 5; scoreText.setText(score.toString()); if (turret.invincible) { scoreText.setStyle({ fill: 0x0000FF }); // Change score text color to blue } else { scoreText.setStyle({ fill: 0xFFFFFF }); // Revert score text color to white } } // 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; }); } if (LK.ticks % (120 * 60 * 60) == 0) { // 120 minutes in ticks var newSphere = new Sphere(); game.addChild(newSphere); spheres.push(newSphere); // Increase zombie spawn rate by 5x for (var i = 0; i < 4; i++) { // Additional 4 zombies for 5x total var newZombie = new Zombie(); game.addChild(newZombie); zombies.push(newZombie); } } };
===================================================================
--- original.js
+++ change.js
@@ -255,9 +255,11 @@
} else if (zombies[j] instanceof Zombie3) {
score += 10;
scoreText.setText(score.toString());
if (turret.invincible) {
- scoreText.style.fill = 0x0000FF; // Change score text color to blue
+ scoreText.setStyle({
+ fill: 0x0000FF
+ }); // Change score text color to blue
} else {
scoreText.setStyle({
fill: 0xFFFFFF
}); // Revert score text color to white
@@ -265,9 +267,11 @@
} else {
score += 5;
scoreText.setText(score.toString());
if (turret.invincible) {
- scoreText.style.fill = 0x0000FF; // Change score text color to blue
+ scoreText.setStyle({
+ fill: 0x0000FF
+ }); // Change score text color to blue
} else {
scoreText.setStyle({
fill: 0xFFFFFF
}); // Revert score text color to white
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.