User prompt
fark biraz daha açılsın
User prompt
zombie2 ölünce çıkan zombiler üst üste değil de birisi çok hafif sağda doğsun
User prompt
çıkan zombiler üst üste değil de birisi çok hafif sağda doğsun
User prompt
zombie2 ölünce içinden 2 tane normal zombi çıksın
User prompt
yeni karakter olarak "zombie2" yap ve diğer zombiye oranla 1/6 şeklinde spawn olsun
User prompt
ölümsüz olmuşlar düzeltir misin
User prompt
zombie2 yi oluştur ve bu zombiler iki mermiyle ölsün ve ölünce 2 tane normal zombi çıkarsınlar
User prompt
zombiler karakterimizden uzakta doğsun haritanın dışından gelsinler
User prompt
hedeflere otomatik olarak ateş etmeyi bırakıp mouse a ateş etsin
User prompt
otomatik olarak mouseun olduğu yere ateş etsin
User prompt
her saniye otomatik olarak 1 mermi atacak şekilde düzelt
User prompt
ilk haline getir
User prompt
ateş etmiyor düzeltir misin
User prompt
mouse u tuttuğumuz yere sürekli olarak ateş etsin
User prompt
turret sürekli olarak ateş etsin
Initial prompt
zombie apocalypse
/**** * 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(); } }; }); //<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)) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }; }); var Zombie2 = 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); LK.showGameOver(); } }; }); /**** * 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> Zombie.prototype.spawnZombie = Zombie2.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 = []; game.down = function (x, y, obj) { turret.shoot(x, y); }; 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 Zombie2) { 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 + 20; // Spawn the second zombie slightly to the right newZombie2.y = zombies[j].y; game.addChild(newZombie2); zombies.push(newZombie2); } zombies[j].destroy(); zombies.splice(j, 1); break; } } } for (var k = zombies.length - 1; k >= 0; k--) { zombies[k].update(); } if (LK.ticks % 60 == 0) { var newZombie = new Zombie(); game.addChild(newZombie); zombies.push(newZombie); } if (LK.ticks % 360 == 0) { var newZombie2 = new Zombie2(); game.addChild(newZombie2); zombies.push(newZombie2); } };
===================================================================
--- original.js
+++ change.js
@@ -130,9 +130,9 @@
newZombie1.y = zombies[j].y;
game.addChild(newZombie1);
zombies.push(newZombie1);
var newZombie2 = new Zombie();
- newZombie2.x = zombies[j].x + 10; // Spawn the second zombie slightly to the right
+ newZombie2.x = zombies[j].x + 20; // Spawn the second zombie slightly to the right
newZombie2.y = zombies[j].y;
game.addChild(newZombie2);
zombies.push(newZombie2);
}
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.