User prompt
bullet yazsın
User prompt
bullets yazmasin ama
User prompt
bullets bar şeklimce player altinda olsun
User prompt
player can barı üstünde gözüksün büyüklüğüde zombi bari gibi olsun rengi ise yeşil.
User prompt
son mermi tek seferde öldüsün
User prompt
mermi atinca zombie rastgele canı gitsin bazende tek mermi atinca ölsün
User prompt
zombie can barını 2 katı büyüt
User prompt
zombie canlari 50 değilde 100 olsun
User prompt
zombie canlari üstlerince gözüksün
User prompt
mermi atinca mor bir çizgi çıkıyor o herneyse sil
User prompt
menzili %25 kücült
User prompt
menzili büyüt
User prompt
basınca mermi atsın
User prompt
yuvarlak daire menzil koy zombiler menzil içindeyse mermi atabilsin
User prompt
menzil çizgisi yok kirmizi renk olsun
User prompt
ateş butonu sil
User prompt
ateş butonu koy mermi atmayi aktifleştirsin
User prompt
ateş butonu koy mermi atsin
User prompt
ateş butonu koy
User prompt
ateş tuşuna ilk bastığımda karakter mermi atabilsin ateş tuşuna ikinci kere basınca karakter mermi atamasın.
User prompt
ates tusu koy
User prompt
ateş etmek icin tetik tuşu yok basında yeşil renk olsun ateş edebileyim tekrar basın ateş edemeyim kapansin böyle tekrarlansin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
cros sil
User prompt
mermi ateş etmesi icin crose koy yön koy
User prompt
basılı tutunca değil basınca mermi ateş etsin
/****
* 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.velocityX = 0;
self.velocityY = 0;
self.damage = 25;
self.update = function () {
self.x += self.velocityX;
self.y += self.velocityY;
// Remove if off screen
if (self.x < -50 || self.x > 2098 || self.y < -50 || self.y > 2782) {
var index = bullets.indexOf(self);
if (index !== -1) {
bullets.splice(index, 1);
}
self.destroy();
}
};
return self;
});
var Coin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('coin', {
anchorX: 0.5,
anchorY: 0.5
});
self.value = 10;
self.lastPlayerDistance = Infinity;
// Start small and grow when spawned
self.scaleX = 0.1;
self.scaleY = 0.1;
tween(self, {
scaleX: 1.75,
scaleY: 1.75
}, {
duration: 800,
easing: tween.bounceOut
});
self.update = function () {
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
// Collect coin if player is close
if (self.lastPlayerDistance > 40 && distance <= 40) {
player.coins += self.value;
LK.getSound('coin').play();
// Animate coin growing before collection
tween(self, {
scaleX: 2.8,
scaleY: 2.8,
alpha: 0
}, {
duration: 300,
easing: tween.easeOut,
onFinish: function onFinish() {
var index = coins.indexOf(self);
if (index !== -1) {
coins.splice(index, 1);
}
self.destroy();
}
});
}
self.lastPlayerDistance = distance;
};
return self;
});
// Game arrays
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.health = 100;
self.maxHealth = 100;
self.speed = 5;
self.damage = 25;
self.armor = 0;
self.coins = 0;
self.shootCooldown = 0;
self.update = function () {
if (self.shootCooldown > 0) {
self.shootCooldown--;
}
};
self.takeDamage = function (damage) {
var actualDamage = Math.max(1, damage - self.armor);
self.health -= actualDamage;
if (self.health <= 0) {
self.health = 0;
LK.showGameOver();
}
};
self.shoot = function (targetX, targetY) {
if (self.shootCooldown > 0 || bulletCount <= 0 || isReloading) return;
var bullet = new Bullet();
bullet.x = self.x;
bullet.y = self.y;
var dx = targetX - self.x;
var dy = targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
bullet.velocityX = dx / distance * 15;
bullet.velocityY = dy / distance * 15;
bullet.damage = self.damage;
bullets.push(bullet);
game.addChild(bullet);
LK.getSound('shoot').play();
self.shootCooldown = 10;
bulletCount--;
// Start reloading if out of bullets
if (bulletCount <= 0) {
isReloading = true;
reloadTimer = 180; // 3 seconds at 60fps
}
};
return self;
});
var Zombie = Container.expand(function () {
var self = Container.call(this);
var zombieGraphics = self.attachAsset('zombie', {
anchorX: 0.5,
anchorY: 0.5
});
self.health = 50;
self.maxHealth = 50;
self.speed = 2;
self.damage = 20;
self.coinValue = 10;
self.lastPlayerDistance = Infinity;
self.update = function () {
var dx = player.x - self.x;
var dy = player.y - 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;
}
// Check collision with player
if (self.lastPlayerDistance > 30 && distance <= 30) {
player.takeDamage(self.damage);
LK.getSound('hit').play();
}
self.lastPlayerDistance = distance;
};
self.takeDamage = function (damage) {
self.health -= damage;
if (self.health <= 0) {
self.die();
}
};
self.die = function () {
var coin = new Coin();
coin.x = self.x;
coin.y = self.y;
coin.value = self.coinValue;
coins.push(coin);
game.addChild(coin);
var index = zombies.indexOf(self);
if (index !== -1) {
zombies.splice(index, 1);
}
self.destroy();
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2a2a2a
});
/****
* Game Code
****/
// Game state
var gameStarted = false;
var bulletCount = 10;
var maxBullets = 10;
var isReloading = false;
var reloadTimer = 0;
var fireButtonActive = false;
// Start menu elements
var titleText = new Text2('ZOMBIE SURVIVAL', {
size: 80,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
LK.gui.center.addChild(titleText);
titleText.y = -200;
var playButton = new Text2('TAP TO START', {
size: 60,
fill: 0x00FF00
});
playButton.anchor.set(0.5, 0.5);
LK.gui.center.addChild(playButton);
playButton.y = 100;
// Game arrays
var zombies = [];
var bullets = [];
var coins = [];
// Game variables
var waveNumber = 1;
var zombiesPerWave = 5;
var spawnTimer = 0;
var zombiesSpawned = 0;
// Player variable (will be created when game starts)
var player = null;
// UI Elements (will be created when game starts)
var healthText = null;
var coinsText = null;
var waveText = null;
var bulletText = null;
function startGame() {
gameStarted = true;
// Hide start menu
titleText.visible = false;
playButton.visible = false;
// Create player
player = game.addChild(new Player());
player.x = 1024;
player.y = 1366;
// Create UI Elements
healthText = new Text2('Health: 100/100', {
size: 40,
fill: 0xFF0000
});
healthText.anchor.set(0, 0);
LK.gui.topLeft.addChild(healthText);
healthText.x = 120;
healthText.y = 20;
coinsText = new Text2('Coins: 0', {
size: 40,
fill: 0xFFD700
});
coinsText.anchor.set(0, 0);
LK.gui.topRight.addChild(coinsText);
coinsText.x = -200;
coinsText.y = 20;
waveText = new Text2('Wave: 1', {
size: 40,
fill: 0xFFFFFF
});
waveText.anchor.set(0.5, 0);
LK.gui.top.addChild(waveText);
waveText.y = 20;
bulletText = new Text2('Bullets: 10/10', {
size: 40,
fill: 0x00FFFF
});
bulletText.anchor.set(0, 0);
LK.gui.topLeft.addChild(bulletText);
bulletText.x = 120;
bulletText.y = 70;
}
// Touch controls
var touchStartX = 0;
var touchStartY = 0;
var isMoving = false;
game.down = function (x, y, obj) {
if (!gameStarted) {
startGame();
return;
}
touchStartX = x;
touchStartY = y;
isMoving = true;
};
game.move = function (x, y, obj) {
if (!gameStarted || !player) return;
if (isMoving) {
var dx = x - touchStartX;
var dy = y - touchStartY;
var newX = player.x + dx * 0.5;
var newY = player.y + dy * 0.5;
// Keep player within bounds
player.x = Math.max(30, Math.min(2018, newX));
player.y = Math.max(30, Math.min(2702, newY));
touchStartX = x;
touchStartY = y;
}
};
game.up = function (x, y, obj) {
if (!gameStarted) return;
isMoving = false;
// Shoot at nearest zombie or forward if no zombies
if (player && bulletCount > 0 && !isReloading) {
// Find nearest zombie as target
var nearestZombie = null;
var minDistance = Infinity;
for (var i = 0; i < zombies.length; i++) {
var zombie = zombies[i];
var dx = zombie.x - player.x;
var dy = zombie.y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < minDistance) {
minDistance = distance;
nearestZombie = zombie;
}
}
// Shoot at nearest zombie or forward if no zombies
if (nearestZombie) {
player.shoot(nearestZombie.x, nearestZombie.y);
} else {
player.shoot(player.x, player.y - 200);
}
}
};
// Game update loop
game.update = function () {
if (!gameStarted || !player) return;
// Handle reloading
if (isReloading) {
reloadTimer--;
if (reloadTimer <= 0) {
bulletCount = maxBullets;
isReloading = false;
}
}
// Update UI
if (healthText && coinsText && waveText && bulletText) {
healthText.setText('Health: ' + player.health + '/' + player.maxHealth);
coinsText.setText('Coins: ' + player.coins);
waveText.setText('Wave: ' + waveNumber);
if (isReloading) {
var reloadTimeLeft = Math.ceil(reloadTimer / 60);
bulletText.setText('Reloading... ' + reloadTimeLeft + 's');
} else {
bulletText.setText('Bullets: ' + bulletCount + '/' + maxBullets);
}
}
// Spawn zombies
if (zombiesSpawned < zombiesPerWave) {
spawnTimer++;
if (spawnTimer >= 60) {
// Spawn every second
spawnTimer = 0;
spawnZombie();
zombiesSpawned++;
}
} else if (zombies.length === 0) {
// Start next wave
waveNumber++;
zombiesPerWave += 2;
zombiesSpawned = 0;
}
// Check bullet-zombie collisions
for (var i = bullets.length - 1; i >= 0; i--) {
var bullet = bullets[i];
var bulletHit = false;
for (var j = zombies.length - 1; j >= 0; j--) {
var zombie = zombies[j];
if (bullet.intersects(zombie)) {
zombie.takeDamage(bullet.damage);
bullets.splice(i, 1);
bullet.destroy();
bulletHit = true;
break;
}
}
}
};
function spawnZombie() {
var zombie = new Zombie();
// Spawn at random edge of screen
var side = Math.floor(Math.random() * 4);
switch (side) {
case 0:
// Top
zombie.x = Math.random() * 2048;
zombie.y = -50;
break;
case 1:
// Right
zombie.x = 2098;
zombie.y = Math.random() * 2732;
break;
case 2:
// Bottom
zombie.x = Math.random() * 2048;
zombie.y = 2782;
break;
case 3:
// Left
zombie.x = -50;
zombie.y = Math.random() * 2732;
break;
}
zombie.health += (waveNumber - 1) * 10; // Increase health with waves
zombie.maxHealth = zombie.health;
zombie.coinValue += Math.floor((waveNumber - 1) * 2);
zombies.push(zombie);
game.addChild(zombie);
} ===================================================================
--- original.js
+++ change.js
@@ -192,9 +192,8 @@
var maxBullets = 10;
var isReloading = false;
var reloadTimer = 0;
var fireButtonActive = false;
-var fireButtonToggleState = false; // false = can't shoot, true = can shoot
// Start menu elements
var titleText = new Text2('ZOMBIE SURVIVAL', {
size: 80,
fill: 0xFFFFFF
@@ -224,9 +223,8 @@
var healthText = null;
var coinsText = null;
var waveText = null;
var bulletText = null;
-var fireButton = null;
function startGame() {
gameStarted = true;
// Hide start menu
titleText.visible = false;
@@ -266,17 +264,8 @@
bulletText.anchor.set(0, 0);
LK.gui.topLeft.addChild(bulletText);
bulletText.x = 120;
bulletText.y = 70;
- // Create fire button
- fireButton = new Text2('ATEŞ', {
- size: 60,
- fill: 0xFF4444
- });
- fireButton.anchor.set(0.5, 0.5);
- LK.gui.bottomRight.addChild(fireButton);
- fireButton.x = -150;
- fireButton.y = -150;
}
// Touch controls
var touchStartX = 0;
var touchStartY = 0;
@@ -285,30 +274,8 @@
if (!gameStarted) {
startGame();
return;
}
- // Check if fire button was pressed
- if (fireButton && x > fireButton.parent.toGlobal(fireButton.position).x - 75 && x < fireButton.parent.toGlobal(fireButton.position).x + 75 && y > fireButton.parent.toGlobal(fireButton.position).y - 40 && y < fireButton.parent.toGlobal(fireButton.position).y + 40) {
- // Toggle fire button state
- fireButtonToggleState = !fireButtonToggleState;
- // Visual feedback based on toggle state
- if (fireButtonToggleState) {
- // Active state - green color, player can now shoot
- tween(fireButton, {
- fill: 0x00FF00
- }, {
- duration: 100
- });
- } else {
- // Inactive state - red color, player cannot shoot
- tween(fireButton, {
- fill: 0xFF4444
- }, {
- duration: 100
- });
- }
- return;
- }
touchStartX = x;
touchStartY = y;
isMoving = true;
};
@@ -328,32 +295,29 @@
};
game.up = function (x, y, obj) {
if (!gameStarted) return;
isMoving = false;
- // Only shoot if fire button toggle is active and not on fire button
- if (fireButtonToggleState && player && bulletCount > 0 && !isReloading) {
- // Check if touch is not on fire button
- if (!(fireButton && x > fireButton.parent.toGlobal(fireButton.position).x - 75 && x < fireButton.parent.toGlobal(fireButton.position).x + 75 && y > fireButton.parent.toGlobal(fireButton.position).y - 40 && y < fireButton.parent.toGlobal(fireButton.position).y + 40)) {
- // Find nearest zombie as target
- var nearestZombie = null;
- var minDistance = Infinity;
- for (var i = 0; i < zombies.length; i++) {
- var zombie = zombies[i];
- var dx = zombie.x - player.x;
- var dy = zombie.y - player.y;
- var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance < minDistance) {
- minDistance = distance;
- nearestZombie = zombie;
- }
+ // Shoot at nearest zombie or forward if no zombies
+ if (player && bulletCount > 0 && !isReloading) {
+ // Find nearest zombie as target
+ var nearestZombie = null;
+ var minDistance = Infinity;
+ for (var i = 0; i < zombies.length; i++) {
+ var zombie = zombies[i];
+ var dx = zombie.x - player.x;
+ var dy = zombie.y - player.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance < minDistance) {
+ minDistance = distance;
+ nearestZombie = zombie;
}
- // Shoot at nearest zombie or forward if no zombies
- if (nearestZombie) {
- player.shoot(nearestZombie.x, nearestZombie.y);
- } else {
- player.shoot(player.x, player.y - 200);
- }
}
+ // Shoot at nearest zombie or forward if no zombies
+ if (nearestZombie) {
+ player.shoot(nearestZombie.x, nearestZombie.y);
+ } else {
+ player.shoot(player.x, player.y - 200);
+ }
}
};
// Game update loop
game.update = function () {
bitcoin sembollü sarı eski madeni para. In-Game asset. 2d. High contrast. No shadows
kırmızı kalp. In-Game asset. 2d. High contrast. No shadows
kadın zombi. In-Game asset. 2d. High contrast. No shadows
daire kırmıza alan. In-Game asset. 2d. High contrast. No shadows
boss zombie şişko. In-Game asset. 2d. High contrast. No shadows
boss zombie şişko kadın makyajlı. In-Game asset. 2d. High contrast. No shadows
tek yumruk boks eldiveni. In-Game asset. 2d. High contrast. No shadows
şakaci komik yüzlü salak gözüken ama cesur bir karakter pistol tutuyor.
boss zombi çok kaslı akıllı ve silahlı sinirli kızgın ve ten rengi kırmızı. In-Game asset. 2d. High contrast. No shadows