User prompt
arka plan yap dağ olmasın kaynak olmasın bulut
User prompt
daha güzel zombilerin olduğu bir dünyanın arka planı
User prompt
daha değişik bir arka plan yap
User prompt
sadece haritanın altından zombi gelsin
User prompt
daha değişik bir arka plan yap
User prompt
arka plan ekle
User prompt
her zombiden 1 mermi düşsün ve oyuna 3 mermiyle başlayalım
User prompt
10 mermiyle başlasın oyun her zombiden 3 mermi gelsin
User prompt
zombiler 1 saniyede bir artsın ve hızlansınlar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
1.5 saniyede bir zombiler hızlansın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Best point yazsın
User prompt
Best Scor yazsın
User prompt
best skor yazsın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
en yüksek skorumuz yazsın ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
mağza sistemini sil
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'toGlobal')' in or related to this line: 'var localPos = self.toLocal(obj.parent.toGlobal(obj.position));' Line Number: 168
User prompt
oyun bittikden sonra shop sistemi olsun ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
wave i sil
User prompt
her zombi öldürdüğümüzde 52 veya 56 arası coin alalım
User prompt
zombiler çeşitli olsun
User prompt
can barını kaldı
User prompt
sol alta zombilerin 3 kere vurunca ölceğimiz bir can barı ekle
User prompt
mermi zombilerin köşesine deyse bile zombi ölsün
User prompt
zombilere tıklayınca ölmesinler
User prompt
tabanca ekle
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 8; self.directionX = 0; self.directionY = 0; self.isDestroyed = false; self.update = function () { if (self.isDestroyed) return; self.x += self.directionX * self.speed; self.y += self.directionY * self.speed; // Remove if off screen if (self.x < -50 || self.x > 2098 || self.y < -50 || self.y > 2782) { self.isDestroyed = true; self.shouldRemove = true; } }; return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); // Add weapon visual var weapon = self.attachAsset('gun', { anchorX: 0.5, anchorY: 1, scaleX: 1, scaleY: 1, y: -25 }); self.aimAtPoint = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var angle = Math.atan2(dy, dx) - Math.PI / 2; weapon.rotation = angle; }; return self; }); var Zombie = Container.expand(function () { var self = Container.call(this); // Choose random zombie type var zombieTypes = ['zombie1', 'zombie2', 'zombie3', 'zombie4']; var zombieType = zombieTypes[Math.floor(Math.random() * zombieTypes.length)]; var zombieGraphics = self.attachAsset(zombieType, { anchorX: 0.5, anchorY: 0.5 }); // Varying speeds based on zombie type var speedVariations = [1.5, 1.2, 1.8, 1.1]; var typeIndex = zombieTypes.indexOf(zombieType); self.speed = speedVariations[typeIndex] + (Math.random() * 0.4 - 0.2); // Add small random variation self.targetX = 1024; self.targetY = 1366; self.isDestroyed = false; self.update = function () { if (self.isDestroyed) return; // Move toward center var dx = self.targetX - self.x; var dy = self.targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 5) { self.x += dx / distance * self.speed; self.y += dy / distance * self.speed; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2F4F4F }); /**** * Game Code ****/ // Game variables var zombies = []; var bullets = []; var player; var scoreTxt; var waveLevel = 1; var zombieSpawnRate = 120; // Spawn every 2 seconds initially var zombieSpeed = 1.5; var lastZombieSpawn = 0; var lastShot = 0; var shootCooldown = 15; // 15 frames between shots (4 shots per second) // Create player at center player = game.addChild(new Player()); player.x = 1024; player.y = 1366; // Create score display scoreTxt = new Text2('0', { size: 100, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); scoreTxt.y = 100; // Wave level display var waveTxt = new Text2('Wave 1', { size: 60, fill: 0xFFFF00 }); waveTxt.anchor.set(0, 0); LK.gui.topRight.addChild(waveTxt); waveTxt.x = -200; waveTxt.y = 50; // Shooting function function shootBullet(targetX, targetY) { if (LK.ticks - lastShot < shootCooldown) return; var bullet = new Bullet(); bullet.x = player.x; bullet.y = player.y; // Calculate direction var dx = targetX - player.x; var dy = targetY - player.y; var distance = Math.sqrt(dx * dx + dy * dy); bullet.directionX = dx / distance; bullet.directionY = dy / distance; bullets.push(bullet); game.addChild(bullet); LK.getSound('gunShot').play(); lastShot = LK.ticks; } // Touch/click controls game.down = function (x, y, obj) { player.aimAtPoint(x, y); shootBullet(x, y); }; function spawnZombie() { var zombie = new Zombie(); // Random spawn from edges var edge = Math.floor(Math.random() * 4); switch (edge) { case 0: // Top zombie.x = Math.random() * 2048; zombie.y = -40; break; case 1: // Right zombie.x = 2088; zombie.y = Math.random() * 2732; break; case 2: // Bottom zombie.x = Math.random() * 2048; zombie.y = 2772; break; case 3: // Left zombie.x = -40; zombie.y = Math.random() * 2732; break; } zombie.speed = zombieSpeed; zombies.push(zombie); game.addChild(zombie); LK.getSound('zombieSpawn').play(); } function checkBulletCollisions() { for (var i = bullets.length - 1; i >= 0; i--) { var bullet = bullets[i]; if (bullet.isDestroyed) continue; for (var j = 0; j < zombies.length; j++) { var zombie = zombies[j]; if (zombie.isDestroyed) continue; var dx = bullet.x - zombie.x; var dy = bullet.y - zombie.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 75) { // Hit zombie bullet.isDestroyed = true; bullet.shouldRemove = true; zombie.isDestroyed = true; LK.getSound('zombieHit').play(); LK.setScore(LK.getScore() + 10); scoreTxt.setText(LK.getScore()); // Create explosion effect var explosion = game.addChild(LK.getAsset('explosion', { anchorX: 0.5, anchorY: 0.5, x: zombie.x, y: zombie.y, scaleX: 0.1, scaleY: 0.1 })); // Animate explosion tween(explosion, { scaleX: 2, scaleY: 2, alpha: 0 }, { duration: 300, easing: tween.easeOut, onFinish: function onFinish() { explosion.destroy(); } }); // Mark zombie for removal for (var k = 0; k < zombies.length; k++) { if (zombies[k] === zombie) { zombies[k].shouldRemove = true; break; } } break; } } } } function checkGameOver() { for (var i = 0; i < zombies.length; i++) { var zombie = zombies[i]; if (zombie.isDestroyed) continue; var dx = zombie.x - player.x; var dy = zombie.y - player.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance < 50) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } } function updateWave() { var currentScore = LK.getScore(); var newWaveLevel = Math.floor(currentScore / 100) + 1; if (newWaveLevel > waveLevel) { waveLevel = newWaveLevel; waveTxt.setText('Wave ' + waveLevel); // Increase difficulty zombieSpawnRate = Math.max(30, zombieSpawnRate - 10); zombieSpeed += 0.3; LK.effects.flashScreen(0x00ff00, 500); } } game.update = function () { // Spawn zombies if (LK.ticks - lastZombieSpawn > zombieSpawnRate) { spawnZombie(); lastZombieSpawn = LK.ticks; } // Clean up destroyed bullets for (var i = bullets.length - 1; i >= 0; i--) { var bullet = bullets[i]; if (bullet.shouldRemove) { bullet.destroy(); bullets.splice(i, 1); } } // Clean up destroyed zombies for (var i = zombies.length - 1; i >= 0; i--) { var zombie = zombies[i]; if (zombie.shouldRemove) { zombie.destroy(); zombies.splice(i, 1); } } // Check bullet collisions checkBulletCollisions(); // Check for game over checkGameOver(); // Update wave progression updateWave(); };
===================================================================
--- original.js
+++ change.js
@@ -51,13 +51,19 @@
return self;
});
var Zombie = Container.expand(function () {
var self = Container.call(this);
- var zombieGraphics = self.attachAsset('zombie', {
+ // Choose random zombie type
+ var zombieTypes = ['zombie1', 'zombie2', 'zombie3', 'zombie4'];
+ var zombieType = zombieTypes[Math.floor(Math.random() * zombieTypes.length)];
+ var zombieGraphics = self.attachAsset(zombieType, {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 1.5;
+ // Varying speeds based on zombie type
+ var speedVariations = [1.5, 1.2, 1.8, 1.1];
+ var typeIndex = zombieTypes.indexOf(zombieType);
+ self.speed = speedVariations[typeIndex] + (Math.random() * 0.4 - 0.2); // Add small random variation
self.targetX = 1024;
self.targetY = 1366;
self.isDestroyed = false;
self.update = function () {
9mm mermi . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
glock29 . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
zombi . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
zombi . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
zombi. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Bir adet bandanası olsun ve yüzünde savaş çizikleri olsun