User prompt
başka bir şarkı koy
User prompt
azccık daha kıs
User prompt
oyun sesini kıs
User prompt
oyunda hep çalan bir şarkı olsun istiyorum
User prompt
bombalar için yazdığımız kodu sil
User prompt
ekrandaki bombalardüşdükten 5 saniye sonra yok olsunlar ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bombalar düşdükten ssonra 5 saniye sonra gitsinler ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bomba düşma saniyesi 25 saniye olsun
User prompt
3.dalga zombilerini öldürünce 15 puan gelsin
User prompt
bombalar azcık büyük olsun
User prompt
bombalar düştüğünde ekran sallansın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
300 puan sonra haritanın rasgele yerlerine 10 saniye bomba düşsün ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
2.dalgadaki zombileri öldürnce 10 puan gelsin
User prompt
mermi atışı birazdaha hızlı gitsin
User prompt
score 500 olunca biraz daha güçlü zombiler gelsinler
User prompt
zombiler biraz daha ffazla olsun
User prompt
ben zombileri öldürünce 5 puan gelsin
User prompt
ben zombileri öldürünce score gelsin ve 20 saniyede 20 puan gelsin
User prompt
score ben zombileri öldürünce artsın ve her 20 saniyede 50 score gelsin
User prompt
score 250 olduktan sonra daha güçlü canavarlar gelsin elinde silah olan
User prompt
otamatik olmasın ben kendim ööldürcem
User prompt
benim bu zombileri bir şekilde öldürmem lazım onun için bana bir silah eklermisin
User prompt
ve biraz karakter yavaşlasın
User prompt
ozaman karakter mouseyi takip etsin
User prompt
zombiler azcık daha hızlı olsunlarr
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var ArmedZombie = Container.expand(function () {
var self = Container.call(this);
var zombieGraphics = self.attachAsset('armedZombie', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 4.0; // Faster than regular zombies
self.health = 3; // Takes 3 hits to kill
self.lastPlayerDistance = Infinity;
self.update = function () {
// Calculate direction to player
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
// Normalize direction and apply speed
if (distance > 0) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
// Check for near miss (was far, now close)
if (self.lastPlayerDistance > 150 && distance <= 150) {
LK.setScore(LK.getScore() + 15); // More points for armed zombies
LK.getSound('nearMiss').play();
updateScoreDisplay();
}
self.lastPlayerDistance = distance;
};
return self;
});
var Bomb = Container.expand(function () {
var self = Container.call(this);
var bombGraphics = self.attachAsset('bomb', {
anchorX: 0.5,
anchorY: 0.5
});
self.countdown = 10000; // 10 seconds in milliseconds
self.warningShown = false;
self.update = function () {
self.countdown -= 16.67; // Approximately 60 FPS
// Flash red when countdown gets low
if (self.countdown <= 3000 && !self.warningShown) {
self.warningShown = true;
tween(bombGraphics, {
alpha: 0.3
}, {
duration: 500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(bombGraphics, {
alpha: 1
}, {
duration: 500,
easing: tween.easeInOut
});
}
});
}
// Explode when countdown reaches zero
if (self.countdown <= 0) {
self.explode();
}
};
self.explode = function () {
// Create explosion effect
LK.effects.flashScreen(0xFF4444, 500);
LK.getSound('bombExplosion').play();
// Add screen shake effect
var originalX = game.x;
var originalY = game.y;
var shakeIntensity = 15;
var shakeDuration = 600;
var shakeCount = 0;
var maxShakes = 12;
function shakeScreen() {
if (shakeCount < maxShakes) {
var shakeX = (Math.random() - 0.5) * shakeIntensity;
var shakeY = (Math.random() - 0.5) * shakeIntensity;
tween(game, {
x: originalX + shakeX,
y: originalY + shakeY
}, {
duration: shakeDuration / maxShakes,
easing: tween.easeInOut,
onFinish: function onFinish() {
shakeCount++;
shakeScreen();
}
});
} else {
// Return to original position
tween(game, {
x: originalX,
y: originalY
}, {
duration: 100,
easing: tween.easeOut
});
}
}
shakeScreen();
// Check if player is within explosion radius (200 pixels)
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance <= 200) {
// Player caught in explosion
LK.getSound('zombieHit').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
// Remove bomb from game
for (var i = bombs.length - 1; i >= 0; i--) {
if (bombs[i] === self) {
bombs.splice(i, 1);
break;
}
}
self.destroy();
};
return self;
});
var Bullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 12;
self.directionX = 0;
self.directionY = 0;
self.update = function () {
self.x += self.directionX * self.speed;
self.y += self.directionY * self.speed;
};
return self;
});
var SuperZombie = Container.expand(function () {
var self = Container.call(this);
var zombieGraphics = self.attachAsset('superZombie', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 5.5; // Fastest zombie
self.health = 5; // Takes 5 hits to kill
self.lastPlayerDistance = Infinity;
self.update = function () {
// Calculate direction to player
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
// Normalize direction and apply speed
if (distance > 0) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
// Check for near miss (was far, now close)
if (self.lastPlayerDistance > 150 && distance <= 150) {
LK.setScore(LK.getScore() + 20); // More points for super zombies
LK.getSound('nearMiss').play();
updateScoreDisplay();
}
self.lastPlayerDistance = distance;
};
return self;
});
var Zombie = Container.expand(function () {
var self = Container.call(this);
var zombieGraphics = self.attachAsset('zombie', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 2.5;
self.lastPlayerDistance = Infinity;
self.update = function () {
// Calculate direction to player
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
// Normalize direction and apply speed
if (distance > 0) {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
// Check for near miss (was far, now close)
if (self.lastPlayerDistance > 150 && distance <= 150) {
LK.setScore(LK.getScore() + 10);
LK.getSound('nearMiss').play();
updateScoreDisplay();
}
self.lastPlayerDistance = distance;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x2F2F2F
});
/****
* Game Code
****/
var player;
var zombies = [];
var armedZombies = [];
var superZombies = [];
var bullets = [];
var bombs = [];
var lastBombDrop = 0;
var bombDropRate = 5000; // Drop bomb every 5 seconds
var dragNode = null;
var gameStartTime = Date.now();
var lastZombieSpawn = 0;
var zombieSpawnRate = 1200; // milliseconds - reduced for more zombies
var difficultyTimer = 0;
var lastShootTime = 0;
var shootCooldown = 300; // milliseconds between shots
var lastScoreBonus = 0; // Track last time bonus was given
// Create score display
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create survival time display
var timeTxt = new Text2('Time: 0s', {
size: 60,
fill: 0xFFFFFF
});
timeTxt.anchor.set(0, 0);
timeTxt.x = 120;
timeTxt.y = 120;
LK.gui.topLeft.addChild(timeTxt);
// Create player
player = game.addChild(new Container());
var playerGraphics = player.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
// Position player at center
player.x = 2048 / 2;
player.y = 2732 / 2;
function updateScoreDisplay() {
scoreTxt.setText('Score: ' + LK.getScore());
}
function shootAtNearestZombie() {
if (zombies.length === 0 && armedZombies.length === 0 && superZombies.length === 0) return;
var nearestZombie = null;
var nearestDistance = Infinity;
var zombieType = 'regular';
// Find nearest regular zombie
for (var i = 0; i < zombies.length; i++) {
var dx = zombies[i].x - player.x;
var dy = zombies[i].y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < nearestDistance) {
nearestDistance = distance;
nearestZombie = zombies[i];
zombieType = 'regular';
}
}
// Find nearest armed zombie
for (var i = 0; i < armedZombies.length; i++) {
var dx = armedZombies[i].x - player.x;
var dy = armedZombies[i].y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < nearestDistance) {
nearestDistance = distance;
nearestZombie = armedZombies[i];
zombieType = 'armed';
}
}
// Find nearest super zombie
for (var i = 0; i < superZombies.length; i++) {
var dx = superZombies[i].x - player.x;
var dy = superZombies[i].y - player.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < nearestDistance) {
nearestDistance = distance;
nearestZombie = superZombies[i];
zombieType = 'super';
}
}
if (nearestZombie) {
var bullet = new Bullet();
bullet.x = player.x;
bullet.y = player.y;
bullet.targetType = zombieType;
// Calculate direction to nearest zombie
var dx = nearestZombie.x - player.x;
var dy = nearestZombie.y - 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('shoot').play();
}
}
function spawnZombie() {
var zombie = new Zombie();
// Spawn zombie at random edge of screen
var edge = Math.floor(Math.random() * 4);
switch (edge) {
case 0:
// Top
zombie.x = Math.random() * 2048;
zombie.y = -50;
break;
case 1:
// Right
zombie.x = 2048 + 50;
zombie.y = Math.random() * 2732;
break;
case 2:
// Bottom
zombie.x = Math.random() * 2048;
zombie.y = 2732 + 50;
break;
case 3:
// Left
zombie.x = -50;
zombie.y = Math.random() * 2732;
break;
}
zombies.push(zombie);
game.addChild(zombie);
}
function spawnArmedZombie() {
var armedZombie = new ArmedZombie();
// Spawn armed zombie at random edge of screen
var edge = Math.floor(Math.random() * 4);
switch (edge) {
case 0:
// Top
armedZombie.x = Math.random() * 2048;
armedZombie.y = -50;
break;
case 1:
// Right
armedZombie.x = 2048 + 50;
armedZombie.y = Math.random() * 2732;
break;
case 2:
// Bottom
armedZombie.x = Math.random() * 2048;
armedZombie.y = 2732 + 50;
break;
case 3:
// Left
armedZombie.x = -50;
armedZombie.y = Math.random() * 2732;
break;
}
armedZombies.push(armedZombie);
game.addChild(armedZombie);
}
function handleMove(x, y, obj) {
// Make character follow mouse/touch position with smoothing for slower movement
var targetX = Math.max(40, Math.min(2048 - 40, x));
var targetY = Math.max(40, Math.min(2732 - 40, y));
// Apply smoothing factor to slow down character movement
var smoothingFactor = 0.05; // Lower value = slower movement
player.x += (targetX - player.x) * smoothingFactor;
player.y += (targetY - player.y) * smoothingFactor;
}
game.move = handleMove;
game.down = function (x, y, obj) {
// Character automatically follows mouse, no need to set dragNode
handleMove(x, y, obj);
// Manual shooting when tapping
var currentTime = Date.now();
if (currentTime - lastShootTime > shootCooldown && (zombies.length > 0 || armedZombies.length > 0 || superZombies.length > 0)) {
shootAtNearestZombie();
lastShootTime = currentTime;
}
};
game.up = function (x, y, obj) {
dragNode = null;
};
game.update = function () {
var currentTime = Date.now();
var survivalTime = Math.floor((currentTime - gameStartTime) / 1000);
// Update survival time display
timeTxt.setText('Time: ' + survivalTime + 's');
// Give 20 points every 20 seconds
if (currentTime - lastScoreBonus >= 20000) {
// 20 seconds in milliseconds
LK.setScore(LK.getScore() + 20);
updateScoreDisplay();
lastScoreBonus = currentTime;
}
// Increase difficulty over time
difficultyTimer++;
if (difficultyTimer % 1800 == 0) {
// Every 30 seconds (1800 frames)
zombieSpawnRate = Math.max(300, zombieSpawnRate - 150);
// Increase zombie speed
for (var i = 0; i < zombies.length; i++) {
zombies[i].speed += 0.5;
}
// Increase armed zombie speed
for (var i = 0; i < armedZombies.length; i++) {
armedZombies[i].speed += 0.5;
}
// Increase super zombie speed
for (var i = 0; i < superZombies.length; i++) {
superZombies[i].speed += 0.5;
}
}
// Spawn zombies
if (currentTime - lastZombieSpawn > zombieSpawnRate) {
if (LK.getScore() >= 500 && Math.random() < 0.3) {
// 30% chance to spawn super zombie after score 500
spawnSuperZombie();
} else if (LK.getScore() >= 250 && Math.random() < 0.6) {
// 60% chance to spawn armed zombie after score 250
spawnArmedZombie();
} else {
spawnZombie();
}
lastZombieSpawn = currentTime;
}
// Check collisions and update zombies
for (var i = zombies.length - 1; i >= 0; i--) {
var zombie = zombies[i];
// Check if zombie caught player
if (zombie.intersects(player)) {
LK.getSound('zombieHit').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
// Remove zombies that are too far off screen
var distanceFromCenter = Math.sqrt(Math.pow(zombie.x - 1024, 2) + Math.pow(zombie.y - 1366, 2));
if (distanceFromCenter > 3000) {
zombie.destroy();
zombies.splice(i, 1);
}
}
// Check collisions and update armed zombies
for (var i = armedZombies.length - 1; i >= 0; i--) {
var armedZombie = armedZombies[i];
// Check if armed zombie caught player
if (armedZombie.intersects(player)) {
LK.getSound('zombieHit').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
// Remove armed zombies that are too far off screen
var distanceFromCenter = Math.sqrt(Math.pow(armedZombie.x - 1024, 2) + Math.pow(armedZombie.y - 1366, 2));
if (distanceFromCenter > 3000) {
armedZombie.destroy();
armedZombies.splice(i, 1);
}
}
// Check collisions and update super zombies
for (var i = superZombies.length - 1; i >= 0; i--) {
var superZombie = superZombies[i];
// Check if super zombie caught player
if (superZombie.intersects(player)) {
LK.getSound('zombieHit').play();
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
// Remove super zombies that are too far off screen
var distanceFromCenter = Math.sqrt(Math.pow(superZombie.x - 1024, 2) + Math.pow(superZombie.y - 1366, 2));
if (distanceFromCenter > 3000) {
superZombie.destroy();
superZombies.splice(i, 1);
}
}
// Update bullets and check collisions
for (var j = bullets.length - 1; j >= 0; j--) {
var bullet = bullets[j];
// Check if bullet hit any zombie
var bulletHit = false;
for (var k = zombies.length - 1; k >= 0; k--) {
var zombie = zombies[k];
if (bullet.intersects(zombie)) {
// Zombie killed
LK.setScore(LK.getScore() + 5);
updateScoreDisplay();
zombie.destroy();
zombies.splice(k, 1);
bullet.destroy();
bullets.splice(j, 1);
bulletHit = true;
break;
}
}
// Check if bullet hit any armed zombie
if (!bulletHit) {
for (var k = armedZombies.length - 1; k >= 0; k--) {
var armedZombie = armedZombies[k];
if (bullet.intersects(armedZombie)) {
// Reduce armed zombie health
armedZombie.health--;
if (armedZombie.health <= 0) {
// Armed zombie killed
LK.setScore(LK.getScore() + 10);
updateScoreDisplay();
armedZombie.destroy();
armedZombies.splice(k, 1);
} else {
// Flash red to show damage
LK.effects.flashObject(armedZombie, 0xff0000, 200);
}
bullet.destroy();
bullets.splice(j, 1);
bulletHit = true;
break;
}
}
}
// Check if bullet hit any super zombie
if (!bulletHit) {
for (var k = superZombies.length - 1; k >= 0; k--) {
var superZombie = superZombies[k];
if (bullet.intersects(superZombie)) {
// Reduce super zombie health
superZombie.health--;
if (superZombie.health <= 0) {
// Super zombie killed
LK.setScore(LK.getScore() + 10);
updateScoreDisplay();
superZombie.destroy();
superZombies.splice(k, 1);
} else {
// Flash red to show damage
LK.effects.flashObject(superZombie, 0xff0000, 200);
}
bullet.destroy();
bullets.splice(j, 1);
bulletHit = true;
break;
}
}
}
// Remove bullet if it went off screen
if (!bulletHit && (bullet.x < -100 || bullet.x > 2148 || bullet.y < -100 || bullet.y > 2832)) {
bullet.destroy();
bullets.splice(j, 1);
}
}
// Spawn bombs after score 300
if (LK.getScore() >= 300 && currentTime - lastBombDrop > bombDropRate) {
spawnBomb();
lastBombDrop = currentTime;
}
// Spawn initial zombie
if (LK.ticks == 120) {
// 2 seconds after game start
spawnZombie();
lastZombieSpawn = currentTime;
}
};
function spawnBomb() {
var bomb = new Bomb();
// Spawn bomb at random location on map
bomb.x = Math.random() * (2048 - 200) + 100; // Keep away from edges
bomb.y = Math.random() * (2732 - 200) + 100;
bombs.push(bomb);
game.addChild(bomb);
// Add dramatic entrance effect
bomb.alpha = 0;
bomb.scaleX = 2;
bomb.scaleY = 2;
tween(bomb, {
alpha: 1,
scaleX: 1,
scaleY: 1
}, {
duration: 800,
easing: tween.bounceOut
});
}
function spawnSuperZombie() {
var superZombie = new SuperZombie();
// Spawn super zombie at random edge of screen
var edge = Math.floor(Math.random() * 4);
switch (edge) {
case 0:
// Top
superZombie.x = Math.random() * 2048;
superZombie.y = -50;
break;
case 1:
// Right
superZombie.x = 2048 + 50;
superZombie.y = Math.random() * 2732;
break;
case 2:
// Bottom
superZombie.x = Math.random() * 2048;
superZombie.y = 2732 + 50;
break;
case 3:
// Left
superZombie.x = -50;
superZombie.y = Math.random() * 2732;
break;
}
superZombies.push(superZombie);
game.addChild(superZombie);
} ===================================================================
--- original.js
+++ change.js
@@ -71,8 +71,42 @@
self.explode = function () {
// Create explosion effect
LK.effects.flashScreen(0xFF4444, 500);
LK.getSound('bombExplosion').play();
+ // Add screen shake effect
+ var originalX = game.x;
+ var originalY = game.y;
+ var shakeIntensity = 15;
+ var shakeDuration = 600;
+ var shakeCount = 0;
+ var maxShakes = 12;
+ function shakeScreen() {
+ if (shakeCount < maxShakes) {
+ var shakeX = (Math.random() - 0.5) * shakeIntensity;
+ var shakeY = (Math.random() - 0.5) * shakeIntensity;
+ tween(game, {
+ x: originalX + shakeX,
+ y: originalY + shakeY
+ }, {
+ duration: shakeDuration / maxShakes,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ shakeCount++;
+ shakeScreen();
+ }
+ });
+ } else {
+ // Return to original position
+ tween(game, {
+ x: originalX,
+ y: originalY
+ }, {
+ duration: 100,
+ easing: tween.easeOut
+ });
+ }
+ }
+ shakeScreen();
// Check if player is within explosion radius (200 pixels)
var dx = player.x - self.x;
var dy = player.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
bir adam elinde silah olsun ve asker gibi giyinsin. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
bu bir mermi . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
bu bir zombi ağızında salyalar olsun ve üstü başı dağınık olsun kirli olsun ve boydan olsun . In-Game asset. 2d. High contrast. No shadows
bana büyük bir zombi yap ama yine ağızında salyalar olsun dağınık olsun ve güçlü dursun. In-Game asset. 2d. High contrast. No shadows
bana füze çiz ucu aşağı baksın. In-Game asset. 2d. High contrast. No shadows