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 = 2 + Math.random() * 1.5; // Slight randomization // Direction vector self.vx = 0; self.vy = 0; // 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; }; 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); // 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) { // Game over 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 killed z2.destroy(); zombies.splice(k, 1); b.destroy(); bullets.splice(j, 1); // Score up score += 1; scoreTxt.setText(score); 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
@@ -25,36 +25,14 @@
self.vy = dy / len * self.speed;
}
};
self.update = function () {
- // No movement for bullets
+ // Move bullet
+ self.x += self.vx;
+ self.y += self.vy;
};
return self;
});
-// BulletPowerup class
-var BulletPowerup = Container.expand(function () {
- var self = Container.call(this);
- var bulletGfx = self.attachAsset('bullet', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.radius = bulletGfx.width / 2;
- // Random value between 1.00 and 2.50 (rounded to 2 decimals)
- self.value = Math.round((1 + Math.random() * 1.5) * 100) / 100;
- // Show value above the bullet
- var valueTxt = new Text2(self.value.toFixed(2), {
- size: 60,
- fill: "#fff"
- });
- valueTxt.anchor.set(0.5, 1);
- valueTxt.y = -bulletGfx.height / 2 - 10;
- self.addChild(valueTxt);
- // For collision detection
- self.update = function () {
- // No movement, but could animate if needed
- };
- return self;
-});
// Hero class
var Hero = Container.expand(function () {
var self = Container.call(this);
var heroGfx = self.attachAsset('hero', {
@@ -135,53 +113,16 @@
game.addChild(hero);
// Bullets and zombies arrays
var bullets = [];
var zombies = [];
-// Powerup array
-var bulletPowerups = [];
// Score
var score = 0;
var scoreTxt = new Text2('0', {
size: 120,
fill: "#fff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
-// Powerup spawn timer
-var bulletPowerupTimeout = null;
-function scheduleNextBulletPowerup() {
- // Random time between 10 and 60 seconds (in ms)
- var nextTime = 10000 + Math.random() * 50000;
- if (bulletPowerupTimeout) LK.clearTimeout(bulletPowerupTimeout);
- bulletPowerupTimeout = LK.setTimeout(function () {
- spawnBulletPowerup();
- scheduleNextBulletPowerup();
- }, nextTime);
-}
-function spawnBulletPowerup() {
- var powerup = new BulletPowerup();
- // Random corner
- var corner = Math.floor(Math.random() * 4);
- if (corner === 0) {
- // top-left
- powerup.x = 0 + powerup.radius;
- powerup.y = 0 + powerup.radius;
- } else if (corner === 1) {
- // top-right
- powerup.x = GAME_W - powerup.radius;
- powerup.y = 0 + powerup.radius;
- } else if (corner === 2) {
- // bottom-left
- powerup.x = 0 + powerup.radius;
- powerup.y = GAME_H - powerup.radius;
- } else {
- // bottom-right
- powerup.x = GAME_W - powerup.radius;
- powerup.y = GAME_H - powerup.radius;
- }
- bulletPowerups.push(powerup);
- game.addChild(powerup);
-}
// Dragging
var dragNode = null;
// Touch/move controls
function handleMove(x, y, obj) {
@@ -298,29 +239,18 @@
LK.showGameOver();
return;
}
}
- // Update and check bullet powerups
- for (var p = bulletPowerups.length - 1; p >= 0; p--) {
- var pu = bulletPowerups[p];
- pu.update && pu.update();
- // Check collision with hero
- var dxp = pu.x - hero.x;
- var dyp = pu.y - hero.y;
- var distp = Math.sqrt(dxp * dxp + dyp * dyp);
- if (distp < pu.radius + hero.radius - 10) {
- // Collect powerup
- score += pu.value;
- score = Math.round(score * 100) / 100; // keep 2 decimals
- scoreTxt.setText(score);
- pu.destroy();
- bulletPowerups.splice(p, 1);
- }
- }
- // Update bullets (no movement, just check collision with zombies)
+ // Update bullets and check collision with zombies
for (var j = bullets.length - 1; j >= 0; j--) {
var b = bullets[j];
- // No b.update(); // Bullets do not move
+ 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;
@@ -354,7 +284,5 @@
hero.y = GAME_H / 2;
// Initial zombie spawn
for (var i = 0; i < 3; i++) {
spawnZombie();
-}
-// Start bullet powerup spawn timer
-scheduleNextBulletPowerup();
\ No newline at end of file
+}
\ No newline at end of file
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