User prompt
can da 5 olsun
User prompt
mermiyi yada 2 saniyede degiştirsin yada
User prompt
yazı olsun yada
User prompt
yazı yerine sarı işaret koy
User prompt
yada üste olsun yazı
User prompt
yazı bayaz olsun
User prompt
şarjor olsun şarjorde 7 tane mermi olsun her sıkışta 1 tane eksilsin ve alta mermiler yazsın mermiler 0 a geldiklerinde ise 3 saniye beklesinler ve alttaki merminin yazılı oldugu yere bide / şu işareti koyucaz onun yanınada yine yazı yazcan her başladıgımız da orda 20 yzıcak bide 3 saniye belerken orda yazan 20 sayısından da 7 veya daha küçük 0 dışında bir sayı çıkarabiliyorsak çıkarıcaz ve o sıfıra geldiginde sılkmicak silah bideekranda mermi bitti yazcak
User prompt
%15 lik oran la 3 can lsun
User prompt
bide bazı zomblerin %30 lik oranla canları 2 % lik oranla canları 3 olsun
User prompt
zombiler bizden %35 yavaş olsu
User prompt
gittikçe daha fazla gelsin az zombiden çoğa doğru
User prompt
hızlandır bizde %20 yavaş olsunlar
User prompt
hızlandır
User prompt
çok az hızlı
User prompt
zombiler bizden yavaş olsun
User prompt
zombilerin 1 canı olsun bide canlarını bizimki gibi olsun
User prompt
zombilerin üstündede canları yazsın
User prompt
canımız gidince de bize buran zombiyi biraz oyuncudan uzaklaştır
User prompt
bide üste 3 adet kalp olsun onlar canımız olsun
User prompt
yada eski halne çevir
User prompt
mermiler hareket etmesin biyerde rskele spawn olsunlar
User prompt
hayır üstün de syı yazan 1,25 arası sayı yazsın ve aldıgımızda sayı altaki sayıyı artır 10,60 saniye raskele aralıklarla çıksın
User prompt
bide mermimiz köşelerde ara sıra mermi olsun
User prompt
silah sıkınca ses çıksın sıkma sesi
User prompt
silah sıkınca çat diye sesler çıksın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Bullet class var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGfx = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.radius = bulletGfx.width / 2; self.speed = 32; // Fast bullet self.vx = 0; self.vy = 0; // Set direction self.setDirection = function (dx, dy) { var len = Math.sqrt(dx * dx + dy * dy); if (len > 0) { self.vx = dx / len * self.speed; self.vy = dy / len * self.speed; } }; self.update = function () { // Move bullet self.x += self.vx; self.y += self.vy; }; return self; }); // Hero class var Hero = Container.expand(function () { var self = Container.call(this); var heroGfx = self.attachAsset('hero', { anchorX: 0.5, anchorY: 0.5 }); // Add a gun to hero's hand // Use the new blue gun asset, positioned to the right hand var gunGfx = self.attachAsset('bluegun', { anchorX: 0.2, anchorY: 0.5, scaleX: 1.2, scaleY: 0.6, x: heroGfx.width * 0.38, // offset to right hand y: 0 }); // Track gun rotation self.gunGfx = gunGfx; self.gunAngle = 0; // For future upgrades: health, weapon, etc. self.radius = heroGfx.width / 2; return self; }); // Zombie class var Zombie = Container.expand(function () { var self = Container.call(this); var zombieGfx = self.attachAsset('zombie', { anchorX: 0.5, anchorY: 0.5 }); self.radius = zombieGfx.width / 2; // Speed will be set on spawn self.speed = 1 + Math.random() * 0.7; // Slower than hero/bullets // Direction vector self.vx = 0; self.vy = 0; // Health for zombie: 1 heart self.maxHealth = 1; self.health = self.maxHealth; // Heart icon(s) above zombie self.heartIcons = []; for (var i = 0; i < self.maxHealth; i++) { var heartIcon = LK.getAsset('heart', { anchorX: 0.5, anchorY: 0.5, x: (i - (self.maxHealth - 1) / 2) * 60, // center hearts y: -self.radius - 40, scaleX: 0.7, scaleY: 0.7 }); self.addChild(heartIcon); self.heartIcons.push(heartIcon); } // Set direction towards hero self.setDirection = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var len = Math.sqrt(dx * dx + dy * dy); if (len > 0) { self.vx = dx / len * self.speed; self.vy = dy / len * self.speed; } }; // Move towards direction self.update = function () { self.x += self.vx; self.y += self.vy; // Keep health text above zombie if (self.healthTxt) { self.healthTxt.x = 0; self.healthTxt.y = -self.radius - 10; } }; // Method to take damage self.takeDamage = function (amount) { self.health -= amount; if (self.health < 0) self.health = 0; // Update heart icons for (var i = 0; i < self.heartIcons.length; i++) { self.heartIcons[i].visible = i < self.health; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x181818 }); /**** * Game Code ****/ // Sound for shooting // Bullet asset: yellow box // Zombie asset: green ellipse // Hero asset: red box // Game area // New blue gun asset var GAME_W = 2048; var GAME_H = 2732; // Hero setup var hero = new Hero(); hero.x = GAME_W / 2; hero.y = GAME_H / 2; game.addChild(hero); // Bullets and zombies arrays var bullets = []; var zombies = []; // Score var score = 0; var scoreTxt = new Text2('0', { size: 120, fill: "#fff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Hearts (health) var maxHearts = 3; var hearts = []; for (var i = 0; i < maxHearts; i++) { var heart = LK.getAsset('heart', { anchorX: 0.5, anchorY: 0.5, x: 160 + i * 120, y: 80, scaleX: 1.1, scaleY: 1.1 }); LK.gui.top.addChild(heart); hearts.push(heart); } var currentHearts = maxHearts; // Dragging var dragNode = null; // Touch/move controls function handleMove(x, y, obj) { // Drag hero if (dragNode === hero) { // Clamp hero inside game area, avoid top left 100x100 var minX = hero.radius + 100; var maxX = GAME_W - hero.radius; var minY = hero.radius; var maxY = GAME_H - hero.radius; hero.x = Math.max(minX, Math.min(maxX, x)); hero.y = Math.max(minY, Math.min(maxY, y)); } } game.move = handleMove; game.down = function (x, y, obj) { // Only drag if touch is on hero var dx = x - hero.x; var dy = y - hero.y; if (dx * dx + dy * dy <= hero.radius * hero.radius) { dragNode = hero; handleMove(x, y, obj); } }; game.up = function (x, y, obj) { dragNode = null; }; // Shooting: tap anywhere not on hero to shoot game.tap = function (x, y, obj) { // Don't shoot if tap is on hero var dx = x - hero.x; var dy = y - hero.y; if (dx * dx + dy * dy <= hero.radius * hero.radius) return; // Create bullet var bullet = new Bullet(); bullet.x = hero.x; bullet.y = hero.y; bullet.setDirection(dx, dy); bullets.push(bullet); game.addChild(bullet); LK.getSound('shoot').play(); // Rotate gun towards shot direction if (typeof hero.gunGfx !== "undefined") { hero.gunGfx.rotation = Math.atan2(dy, dx); } }; game.down = function (x, y, obj) { // Drag or shoot var dx = x - hero.x; var dy = y - hero.y; if (dx * dx + dy * dy <= hero.radius * hero.radius) { dragNode = hero; handleMove(x, y, obj); } else { // Shoot var bullet = new Bullet(); bullet.x = hero.x; bullet.y = hero.y; bullet.setDirection(dx, dy); bullets.push(bullet); game.addChild(bullet); LK.getSound('shoot').play(); // Rotate gun towards shot direction if (typeof hero.gunGfx !== "undefined") { hero.gunGfx.rotation = Math.atan2(dy, dx); } } }; // Zombie spawn timer var zombieSpawnInterval = 90; // frames var zombieSpawnTimer = 0; // Helper: spawn zombie at random edge function spawnZombie() { var zombie = new Zombie(); // Random edge: 0=top,1=bottom,2=left,3=right var edge = Math.floor(Math.random() * 4); var margin = 80; if (edge === 0) { // top zombie.x = margin + Math.random() * (GAME_W - 2 * margin); zombie.y = -zombie.radius; } else if (edge === 1) { // bottom zombie.x = margin + Math.random() * (GAME_W - 2 * margin); zombie.y = GAME_H + zombie.radius; } else if (edge === 2) { // left zombie.x = -zombie.radius; zombie.y = margin + Math.random() * (GAME_H - 2 * margin); } else { // right zombie.x = GAME_W + zombie.radius; zombie.y = margin + Math.random() * (GAME_H - 2 * margin); } zombie.setDirection(hero.x, hero.y); zombies.push(zombie); game.addChild(zombie); } // Main update loop game.update = function () { // Update zombies for (var i = zombies.length - 1; i >= 0; i--) { var z = zombies[i]; // Always update direction towards hero z.setDirection(hero.x, hero.y); z.update(); // Check collision with hero var dx = z.x - hero.x; var dy = z.y - hero.y; var dist = Math.sqrt(dx * dx + dy * dy); if (dist < z.radius + hero.radius - 10) { // Lose a heart if (currentHearts > 0) { currentHearts--; // Hide a heart visually if (hearts[currentHearts]) { hearts[currentHearts].visible = false; } LK.effects.flashObject(hero, 0xff0000, 400); // Move zombie that hit away from hero instead of destroying // Calculate vector from hero to zombie var awayDx = z.x - hero.x; var awayDy = z.y - hero.y; var awayLen = Math.sqrt(awayDx * awayDx + awayDy * awayDy); // Move zombie 400px away from hero, but clamp inside game area if (awayLen > 0) { var moveDist = 400; var newX = hero.x + awayDx / awayLen * moveDist; var newY = hero.y + awayDy / awayLen * moveDist; // Clamp to game area (with margin for zombie size) var margin = z.radius + 20; newX = Math.max(margin, Math.min(GAME_W - margin, newX)); newY = Math.max(margin, Math.min(GAME_H - margin, newY)); z.x = newX; z.y = newY; } // If no hearts left, game over if (currentHearts === 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } } } // Update bullets and check collision with zombies for (var j = bullets.length - 1; j >= 0; j--) { var b = bullets[j]; b.update && b.update(); // Remove bullet if out of bounds if (b.x < -b.radius || b.x > GAME_W + b.radius || b.y < -b.radius || b.y > GAME_H + b.radius) { b.destroy(); bullets.splice(j, 1); continue; } // Check collision with zombies for (var k = zombies.length - 1; k >= 0; k--) { var z2 = zombies[k]; var dx2 = b.x - z2.x; var dy2 = b.y - z2.y; var dist2 = Math.sqrt(dx2 * dx2 + dy2 * dy2); if (dist2 < b.radius + z2.radius - 10) { // Zombie takes damage if (typeof z2.takeDamage === "function") { z2.takeDamage(1); // If health reaches zero, destroy if (z2.health <= 0) { z2.destroy(); zombies.splice(k, 1); // Score up score += 1; scoreTxt.setText(score); } } else { // fallback: destroy if no health system z2.destroy(); zombies.splice(k, 1); score += 1; scoreTxt.setText(score); } b.destroy(); bullets.splice(j, 1); break; } } } // Spawn zombies zombieSpawnTimer++; if (zombieSpawnTimer >= zombieSpawnInterval) { spawnZombie(); zombieSpawnTimer = 0; // Gradually increase spawn rate if (zombieSpawnInterval > 30) zombieSpawnInterval -= 1; } // No random bullet spawn at corners }; // Center hero on start hero.x = GAME_W / 2; hero.y = GAME_H / 2; // Initial zombie spawn for (var i = 0; i < 3; i++) { spawnZombie(); }
===================================================================
--- original.js
+++ change.js
@@ -65,9 +65,9 @@
anchorY: 0.5
});
self.radius = zombieGfx.width / 2;
// Speed will be set on spawn
- self.speed = 2 + Math.random() * 1.5; // Slight randomization
+ self.speed = 1 + Math.random() * 0.7; // Slower than hero/bullets
// Direction vector
self.vx = 0;
self.vy = 0;
// Health for zombie: 1 heart
mermi. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
oyuncu,karekter. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
silah. 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