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"); var storage = LK.import("@upit/storage.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 ****/ // Create bright blue sky var sky = game.addChild(LK.getAsset('sky', { anchorX: 0, anchorY: 0, x: 0, y: 0, tint: 0x87CEEB })); // Add sun var sun = game.addChild(LK.getAsset('leaves', { anchorX: 0.5, anchorY: 0.5, x: 1700, y: 250, scaleX: 1.5, scaleY: 1.5, tint: 0xFFD700 })); // Add ground layer var ground = game.addChild(LK.getAsset('ground', { anchorX: 0, anchorY: 0, x: 0, y: 1366, tint: 0x8B4513 })); // Add grass layer var grass = game.addChild(LK.getAsset('grass', { anchorX: 0, anchorY: 0, x: 0, y: 1166, tint: 0x228B22 })); // Add forest trees var treePositions = [150, 350, 550, 750, 950, 1150, 1350, 1550, 1750, 1950]; for (var t = 0; t < treePositions.length; t++) { var treeX = treePositions[t]; var treeHeight = 180 + Math.random() * 80; var tree = game.addChild(LK.getAsset('tree', { anchorX: 0.5, anchorY: 1, x: treeX, y: 1366, scaleX: 1.2 + Math.random() * 0.8, scaleY: treeHeight / 200, tint: 0x8B4513 })); // Add green leaves to trees var leaves = game.addChild(LK.getAsset('leaves', { anchorX: 0.5, anchorY: 0.5, x: treeX, y: 1366 - treeHeight + 60, scaleX: 1.3 + Math.random() * 0.5, scaleY: 1.3 + Math.random() * 0.5, tint: 0x228B22 })); } // Game variables var zombies = []; var bullets = []; var player; var scoreTxt; var highScoreTxt; var bulletCountTxt; var bulletCount = 3; // Start with 3 bullets var highScore = storage.highScore || 0; 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) var lastSpeedIncrease = 0; var speedIncreaseInterval = 60; // 1 second at 60fps // 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; // Create high score display highScoreTxt = new Text2('Best Point: ' + highScore, { size: 60, fill: 0xFFD700 }); highScoreTxt.anchor.set(1, 0); LK.gui.topRight.addChild(highScoreTxt); highScoreTxt.x = -120; highScoreTxt.y = 50; // Create bullet count display bulletCountTxt = new Text2('Bullets: ' + bulletCount, { size: 60, fill: 0xFFFFFF }); bulletCountTxt.anchor.set(0, 0); LK.gui.topLeft.addChild(bulletCountTxt); bulletCountTxt.x = 120; bulletCountTxt.y = 50; // Shooting function function shootBullet(targetX, targetY) { if (LK.ticks - lastShot < shootCooldown) return; if (bulletCount <= 0) return; // Can't shoot if no bullets left 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; bulletCount--; // Decrease bullet count bulletCountTxt.setText('Bullets: ' + bulletCount); // Update display } // Touch/click controls game.down = function (x, y, obj) { player.aimAtPoint(x, y); shootBullet(x, y); }; function spawnZombie() { var zombie = new Zombie(); // Spawn only from bottom of the map zombie.x = Math.random() * 2048; zombie.y = 2772; 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(); // Add random coin reward between 52-56 var coinReward = Math.floor(Math.random() * 5) + 52; // Random between 52-56 LK.setScore(LK.getScore() + coinReward); scoreTxt.setText(LK.getScore()); // Add 1 bullet reward bulletCount += 1; bulletCountTxt.setText('Bullets: ' + bulletCount); // Update high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; highScoreTxt.setText('Best Point: ' + highScore); } // 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; } } } game.update = function () { // Increase zombie speed every 1 second and spawn more zombies if (LK.ticks - lastSpeedIncrease > speedIncreaseInterval) { zombieSpeed += 0.1; // Increase speed by 0.1 // Decrease spawn rate to spawn zombies more frequently (lower value = more frequent spawning) if (zombieSpawnRate > 30) { // Don't go below 30 frames (0.5 seconds) zombieSpawnRate -= 5; // Spawn zombies 5 frames sooner each time } // Update existing zombies' speed for (var i = 0; i < zombies.length; i++) { if (!zombies[i].isDestroyed) { zombies[i].speed = zombieSpeed + (Math.random() * 0.4 - 0.2); } } lastSpeedIncrease = LK.ticks; } // 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(); };
===================================================================
--- original.js
+++ change.js
@@ -90,196 +90,67 @@
/****
* Game Code
****/
-// Create dark, apocalyptic sky with gradient layers
-var skyTop = game.addChild(LK.getAsset('sky', {
+// Create bright blue sky
+var sky = game.addChild(LK.getAsset('sky', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
- scaleY: 0.5,
- tint: 0x2F1B14
+ tint: 0x87CEEB
}));
-var skyMid = game.addChild(LK.getAsset('sky', {
- anchorX: 0,
- anchorY: 0,
- x: 0,
- y: 350,
- scaleY: 0.6,
- tint: 0x4A2C2A,
- alpha: 0.8
-}));
-var skyLow = game.addChild(LK.getAsset('sky', {
- anchorX: 0,
- anchorY: 0,
- x: 0,
- y: 700,
- scaleY: 0.4,
- tint: 0x8B4513,
- alpha: 0.6
-}));
-// Add eerie red moon
-var moon = game.addChild(LK.getAsset('leaves', {
+// Add sun
+var sun = game.addChild(LK.getAsset('leaves', {
anchorX: 0.5,
anchorY: 0.5,
x: 1700,
y: 250,
- scaleX: 1.8,
- scaleY: 1.8,
- tint: 0xB22222,
- alpha: 0.9
+ scaleX: 1.5,
+ scaleY: 1.5,
+ tint: 0xFFD700
}));
-// Add distant ruined city silhouette
-for (var m = 0; m < 8; m++) {
- var buildingX = m * 300 - 100;
- var buildingHeight = 3 + Math.random() * 3;
- var building = game.addChild(LK.getAsset('tree', {
- anchorX: 0.5,
- anchorY: 1,
- x: buildingX,
- y: 950,
- scaleX: 6 + Math.random() * 4,
- scaleY: buildingHeight,
- tint: 0x1C1C1C,
- alpha: 0.7
- }));
-}
-// Add layered apocalyptic ground
-var groundDeep = game.addChild(LK.getAsset('ground', {
+// Add ground layer
+var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 0,
x: 0,
- y: 1500,
- tint: 0x3C2414
+ y: 1366,
+ tint: 0x8B4513
}));
-var ground = game.addChild(LK.getAsset('ground', {
+// Add grass layer
+var grass = game.addChild(LK.getAsset('grass', {
anchorX: 0,
anchorY: 0,
x: 0,
- y: 1366,
- scaleY: 0.8,
- tint: 0x654321
+ y: 1166,
+ tint: 0x228B22
}));
-// Add dead grass patches and dirt
-for (var g = 0; g < 6; g++) {
- var grassPatch = game.addChild(LK.getAsset('grass', {
- anchorX: 0,
- anchorY: 0,
- x: g * 340,
- y: 1166 + Math.random() * 60,
- scaleY: 0.6 + Math.random() * 0.3,
- tint: 0x556B2F - Math.random() * 0x111100,
- alpha: 0.7
- }));
-}
-// Add ominous storm clouds
-var cloudFormations = [{
- x: 200,
- y: 180,
- scale: 1.5,
- tint: 0x2F2F2F
-}, {
- x: 650,
- y: 140,
- scale: 1.8,
- tint: 0x404040
-}, {
- x: 1100,
- y: 200,
- scale: 1.3,
- tint: 0x363636
-}, {
- x: 1500,
- y: 160,
- scale: 1.6,
- tint: 0x2A2A2A
-}, {
- x: 1850,
- y: 220,
- scale: 1.4,
- tint: 0x333333
-}];
-for (var c = 0; c < cloudFormations.length; c++) {
- var cloudData = cloudFormations[c];
- var cloudType = c % 2 === 0 ? 'cloud1' : 'cloud2';
- var cloud = game.addChild(LK.getAsset(cloudType, {
- anchorX: 0.5,
- anchorY: 0.5,
- x: cloudData.x,
- y: cloudData.y,
- scaleX: cloudData.scale,
- scaleY: cloudData.scale,
- tint: cloudData.tint,
- alpha: 0.6 + Math.random() * 0.2
- }));
-}
-// Add dead, twisted trees
-var treePositions = [120, 340, 520, 750, 980, 1200, 1450, 1650, 1850];
+// Add forest trees
+var treePositions = [150, 350, 550, 750, 950, 1150, 1350, 1550, 1750, 1950];
for (var t = 0; t < treePositions.length; t++) {
var treeX = treePositions[t];
- var treeHeight = 160 + Math.random() * 100;
- var treeWidth = 50 + Math.random() * 30;
+ var treeHeight = 180 + Math.random() * 80;
var tree = game.addChild(LK.getAsset('tree', {
anchorX: 0.5,
anchorY: 1,
x: treeX,
y: 1366,
- scaleX: treeWidth / 80,
+ scaleX: 1.2 + Math.random() * 0.8,
scaleY: treeHeight / 200,
- tint: 0x2F1B14,
- alpha: 0.8
+ tint: 0x8B4513
}));
- // Add sparse, dead leaves
- if (Math.random() < 0.6) {
- var leavesSize = 80 + Math.random() * 40;
- var leaves = game.addChild(LK.getAsset('leaves', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: treeX + (Math.random() - 0.5) * 40,
- y: 1366 - treeHeight + 60,
- scaleX: leavesSize / 150,
- scaleY: leavesSize / 150,
- tint: 0x4A4A2F,
- alpha: 0.6
- }));
- }
-}
-// Add debris and ruins
-for (var r = 0; r < 8; r++) {
- var debrisX = 180 + r * 240 + Math.random() * 80;
- var debris = game.addChild(LK.getAsset('explosion', {
+ // Add green leaves to trees
+ var leaves = game.addChild(LK.getAsset('leaves', {
anchorX: 0.5,
- anchorY: 1,
- x: debrisX,
- y: 1366,
- scaleX: 1.5 + Math.random() * 1.5,
- scaleY: 1 + Math.random() * 0.8,
- tint: 0x696969,
- alpha: 0.7
+ anchorY: 0.5,
+ x: treeX,
+ y: 1366 - treeHeight + 60,
+ scaleX: 1.3 + Math.random() * 0.5,
+ scaleY: 1.3 + Math.random() * 0.5,
+ tint: 0x228B22
}));
}
-// Add atmospheric fog layers
-var fog1 = game.addChild(LK.getAsset('cloud1', {
- anchorX: 0,
- anchorY: 0,
- x: 0,
- y: 1000,
- scaleX: 8,
- scaleY: 2,
- tint: 0x708090,
- alpha: 0.15
-}));
-var fog2 = game.addChild(LK.getAsset('cloud2', {
- anchorX: 0,
- anchorY: 0,
- x: 400,
- y: 1100,
- scaleX: 6,
- scaleY: 1.5,
- tint: 0x2F4F4F,
- alpha: 0.12
-}));
// Game variables
var zombies = [];
var bullets = [];
var player;
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