User prompt
5 dalgali 100 bölüm olsun.Her 10 bölümde düşmanlar değişsin.
User prompt
heroyun 5 dalga olsun.
User prompt
her isabette 5 puan kazanılsın.
User prompt
alt ekran arkla planda dağlar olsun önünde ağaçlar. ve göl.
User prompt
arka ekranda bulut ve güneş olsun.
User prompt
silah kulesi en fazla 2 olsun.
User prompt
silah kulesi en fazla 3 olsun
Initial prompt
her kuş 5 puan olsun.her dalga 100 puanda değişsin.
/**** * Classes ****/ var Bird = Container.expand(function (birdType) { var self = Container.call(this); // Set bird type (1-6) self.birdType = birdType || Math.floor(Math.random() * 6) + 1; var assetName = 'bird' + self.birdType; var birdGraphics = self.attachAsset(assetName, { anchorX: 0.5, anchorY: 0.5 }); // Different properties for each bird type var birdConfigs = { 1: { speedMultiplier: 1.0, bounceChance: 0.8, points: 5, color: 0xffffff }, 2: { speedMultiplier: 0.7, bounceChance: 0.9, points: 5, color: 0x8B4513 }, // Eagle - slower, more points 3: { speedMultiplier: 1.5, bounceChance: 0.6, points: 5, color: 0x654321 }, // Sparrow - fast, bonus points 4: { speedMultiplier: 0.5, bounceChance: 0.95, points: 5, color: 0x2F4F4F }, // Hawk - slow, high points 5: { speedMultiplier: 2.0, bounceChance: 0.4, points: 5, color: 0xFF6347 }, // Robin - very fast, highest points 6: { speedMultiplier: 1.2, bounceChance: 0.7, points: 5, color: 0x000000 } // Crow - medium speed }; var config = birdConfigs[self.birdType]; birdGraphics.tint = config.color; self.speedX = (Math.random() * 4 + 2) * config.speedMultiplier * (Math.random() > 0.5 ? 1 : -1); self.speedY = (Math.random() * 2 - 1) * config.speedMultiplier; self.bounceChance = config.bounceChance; self.points = config.points; self.lastX = 0; self.lastY = 0; self.update = function () { self.lastX = self.x; self.lastY = self.y; self.x += self.speedX; self.y += self.speedY; // Bounce off top and bottom with chance based on bird type if (self.y < 100 || self.y > 2632) { if (Math.random() < self.bounceChance) { self.speedY *= -1; } } }; return self; }); var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 0; self.speedY = 0; self.lastX = 0; self.lastY = 0; self.update = function () { self.lastX = self.x; self.lastY = self.y; self.x += self.speedX; self.y += self.speedY; }; return self; }); var Gun = Container.expand(function () { var self = Container.call(this); var gunGraphics = self.attachAsset('gun', { anchorX: 0.5, anchorY: 1.0 }); self.targetX = 0; self.targetY = 0; self.aimAt = function (x, y) { self.targetX = x; self.targetY = y; var dx = x - self.x; var dy = y - self.y; var angle = Math.atan2(dy, dx); gunGraphics.rotation = angle + Math.PI / 2; }; return self; }); /**** * Initialize Game ****/ // Game variables var game = new LK.Game({ backgroundColor: 0x87CEEB }); /**** * Game Code ****/ // Game variables var birds = []; var bullets = []; var guns = []; var lastBirdSpawn = 0; var gameStarted = false; var bulletsPerShot = 1; var gunCount = 1; var lastScoreCheckpoint = 0; var health = 20; var clouds = []; var currentWave = 1; var maxWaves = 5; var currentChapter = 1; var maxChapters = 100; var birdsKilledThisWave = 0; var birdsNeededPerWave = [10, 15, 20, 25, 30]; // Birds needed to complete each wave var waveStarted = false; // Enemy types for each 10-chapter group var enemyTypesByChapter = [[1, 2], // Chapters 1-10: birds 1-2 [2, 3], // Chapters 11-20: birds 2-3 [3, 4], // Chapters 21-30: birds 3-4 [4, 5], // Chapters 31-40: birds 4-5 [5, 6], // Chapters 41-50: birds 5-6 [1, 3, 5], // Chapters 51-60: birds 1,3,5 [2, 4, 6], // Chapters 61-70: birds 2,4,6 [1, 2, 3, 4], // Chapters 71-80: birds 1-4 [3, 4, 5, 6], // Chapters 81-90: birds 3-6 [1, 2, 3, 4, 5, 6] // Chapters 91-100: all birds ]; // Create sun var sun = game.addChild(LK.getAsset('sun', { anchorX: 0.5, anchorY: 0.5 })); sun.x = 1800; sun.y = 300; // Create clouds for (var c = 0; c < 5; c++) { var cloud = game.addChild(LK.getAsset('cloud', { anchorX: 0.5, anchorY: 0.5, scaleX: 0.8 + Math.random() * 0.6, scaleY: 0.8 + Math.random() * 0.6 })); cloud.x = Math.random() * 2048; cloud.y = Math.random() * 400 + 100; cloud.speedX = (Math.random() * 2 + 1) * (Math.random() > 0.5 ? 1 : -1); cloud.alpha = 0.7; clouds.push(cloud); } // Create mountains in background var mountains = []; for (var m = 0; m < 6; m++) { var mountainType = m % 3 + 1; var mountain = game.addChild(LK.getAsset('mountain' + mountainType, { anchorX: 0.5, anchorY: 1.0 })); mountain.x = m * 350 + 200; mountain.y = 2400; mountain.alpha = 0.6; mountains.push(mountain); } // Create lake var lake = game.addChild(LK.getAsset('lake', { anchorX: 0.5, anchorY: 1.0 })); lake.x = 1024; lake.y = 2500; lake.alpha = 0.7; // Create trees in foreground var trees = []; for (var t = 0; t < 8; t++) { // Create tree trunk var trunk = game.addChild(LK.getAsset('trunk', { anchorX: 0.5, anchorY: 1.0 })); trunk.x = t * 250 + 150 + Math.random() * 100; trunk.y = 2550; // Create tree foliage var tree = game.addChild(LK.getAsset('tree', { anchorX: 0.5, anchorY: 1.0 })); tree.x = trunk.x; tree.y = trunk.y - 35; tree.scaleX = 0.8 + Math.random() * 0.4; tree.scaleY = 0.8 + Math.random() * 0.4; trees.push({ trunk: trunk, tree: tree }); } // Create initial gun at bottom center function createGun(index) { var gun = game.addChild(new Gun()); var spacing = 2048 / (gunCount + 1); gun.x = spacing * (index + 1); gun.y = 2600; return gun; } // Initialize first gun guns.push(createGun(0)); // Score display var scoreTxt = new Text2('Score: 0', { size: 80, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Health display var healthTxt = new Text2('Health: 20', { size: 80, fill: 0xFF0000 }); healthTxt.anchor.set(0.5, 0); healthTxt.y = 120; LK.gui.top.addChild(healthTxt); // Wave display var waveTxt = new Text2('Chapter: 1/100 - Wave: 1/5 (0/10)', { size: 60, fill: 0x00FF00 }); waveTxt.anchor.set(0.5, 0); waveTxt.y = 200; LK.gui.top.addChild(waveTxt); // Instructions var instructionTxt = new Text2('Tap to aim and shoot flying birds!', { size: 60, fill: 0xFFFF00 }); instructionTxt.anchor.set(0.5, 0.5); instructionTxt.x = 1024; instructionTxt.y = 1366; game.addChild(instructionTxt); // Remove instructions after 3 seconds LK.setTimeout(function () { if (instructionTxt.parent) { instructionTxt.destroy(); } }, 3000); // Game controls game.down = function (x, y, obj) { gameStarted = true; // Each gun fires multiple bullets for (var g = 0; g < guns.length; g++) { var gun = guns[g]; // Aim gun gun.aimAt(x, y); // Fire multiple bullets per gun for (var b = 0; b < bulletsPerShot; b++) { var bullet = game.addChild(new Bullet()); bullet.x = gun.x; bullet.y = gun.y - 60; bullet.lastX = bullet.x; bullet.lastY = bullet.y; // Calculate bullet direction with slight spread for multiple bullets var dx = x - gun.x; var dy = y - gun.y; var distance = Math.sqrt(dx * dx + dy * dy); var speed = 60; // Add spread for multiple bullets var spreadAngle = (b - (bulletsPerShot - 1) / 2) * 0.2; var angle = Math.atan2(dy, dx) + spreadAngle; bullet.speedX = Math.cos(angle) * speed; bullet.speedY = Math.sin(angle) * speed; bullets.push(bullet); } } // Play shoot sound LK.getSound('shoot').play(); }; // Spawn birds periodically function spawnBird() { // Get available enemy types for current chapter var chapterGroup = Math.min(Math.floor((currentChapter - 1) / 10), 9); var availableEnemies = enemyTypesByChapter[chapterGroup]; // Create random bird type from available enemies for this chapter var randomIndex = Math.floor(Math.random() * availableEnemies.length); var randomBirdType = availableEnemies[randomIndex]; var bird = game.addChild(new Bird(randomBirdType)); // Random spawn from sides if (Math.random() > 0.5) { bird.x = -50; bird.speedX = Math.abs(bird.speedX); } else { bird.x = 2098; bird.speedX = -Math.abs(bird.speedX); } bird.y = Math.random() * 1500 + 200; bird.lastX = bird.x; bird.lastY = bird.y; birds.push(bird); } // Main game update game.update = function () { if (!gameStarted) return; // Check wave completion if (birdsKilledThisWave >= birdsNeededPerWave[currentWave - 1]) { if (currentWave >= maxWaves) { // Chapter completed if (currentChapter >= maxChapters) { // All chapters completed - player wins! LK.showYouWin(); return; } else { // Move to next chapter currentChapter++; currentWave = 1; birdsKilledThisWave = 0; waveStarted = false; // Reset health for new chapter health = 20; healthTxt.setText('Health: ' + health); } } else { // Move to next wave currentWave++; birdsKilledThisWave = 0; waveStarted = false; // Wave upgrades if (currentWave === 2 && guns.length < 2) { gunCount++; guns.push(createGun(guns.length)); } if (currentWave === 3 && bulletsPerShot < 2) { bulletsPerShot++; } if (currentWave === 4 && guns.length < 2) { gunCount++; if (guns.length < 2) guns.push(createGun(guns.length)); } if (currentWave === 5 && bulletsPerShot < 3) { bulletsPerShot++; } } } // Update wave display waveTxt.setText('Chapter: ' + currentChapter + '/' + maxChapters + ' - Wave: ' + currentWave + '/' + maxWaves + ' (' + birdsKilledThisWave + '/' + birdsNeededPerWave[currentWave - 1] + ')'); // Spawn birds based on current wave (higher waves spawn faster) var spawnDelay = Math.max(15, 40 - currentWave * 5); if (LK.ticks - lastBirdSpawn > spawnDelay) { spawnBird(); lastBirdSpawn = LK.ticks; waveStarted = true; } // Update and check birds for (var i = birds.length - 1; i >= 0; i--) { var bird = birds[i]; // Remove birds that flew off screen and decrease health if (bird.lastX >= -100 && bird.x < -100) { health--; healthTxt.setText('Health: ' + health); bird.destroy(); birds.splice(i, 1); if (health <= 0) { LK.showGameOver(); return; } continue; } if (bird.lastX <= 2148 && bird.x > 2148) { health--; healthTxt.setText('Health: ' + health); bird.destroy(); birds.splice(i, 1); if (health <= 0) { LK.showGameOver(); return; } continue; } } // Update clouds for (var c = 0; c < clouds.length; c++) { var cloud = clouds[c]; cloud.x += cloud.speedX * 0.5; // Wrap clouds around screen if (cloud.x > 2148) { cloud.x = -100; } else if (cloud.x < -100) { cloud.x = 2148; } } // Update and check bullets for (var j = bullets.length - 1; j >= 0; j--) { var bullet = bullets[j]; // Remove bullets that go off screen if (bullet.x < -50 || bullet.x > 2098 || bullet.y < -50 || bullet.y > 2782) { bullet.destroy(); bullets.splice(j, 1); continue; } // Check bullet-bird collisions for (var k = birds.length - 1; k >= 0; k--) { var bird = birds[k]; if (bullet.intersects(bird)) { // Hit! Award 5 points for each hit LK.setScore(LK.getScore() + 5); scoreTxt.setText('Score: ' + LK.getScore()); // Increment wave kill counter birdsKilledThisWave++; // Play hit sound LK.getSound('hit').play(); // Flash bird and remove LK.effects.flashObject(bird, 0xff0000, 200); // Remove bullet and bird bullet.destroy(); bullets.splice(j, 1); bird.destroy(); birds.splice(k, 1); break; } } } };
===================================================================
--- original.js
+++ change.js
@@ -135,11 +135,34 @@
var health = 20;
var clouds = [];
var currentWave = 1;
var maxWaves = 5;
+var currentChapter = 1;
+var maxChapters = 100;
var birdsKilledThisWave = 0;
var birdsNeededPerWave = [10, 15, 20, 25, 30]; // Birds needed to complete each wave
var waveStarted = false;
+// Enemy types for each 10-chapter group
+var enemyTypesByChapter = [[1, 2],
+// Chapters 1-10: birds 1-2
+[2, 3],
+// Chapters 11-20: birds 2-3
+[3, 4],
+// Chapters 21-30: birds 3-4
+[4, 5],
+// Chapters 31-40: birds 4-5
+[5, 6],
+// Chapters 41-50: birds 5-6
+[1, 3, 5],
+// Chapters 51-60: birds 1,3,5
+[2, 4, 6],
+// Chapters 61-70: birds 2,4,6
+[1, 2, 3, 4],
+// Chapters 71-80: birds 1-4
+[3, 4, 5, 6],
+// Chapters 81-90: birds 3-6
+[1, 2, 3, 4, 5, 6] // Chapters 91-100: all birds
+];
// Create sun
var sun = game.addChild(LK.getAsset('sun', {
anchorX: 0.5,
anchorY: 0.5
@@ -230,10 +253,10 @@
healthTxt.anchor.set(0.5, 0);
healthTxt.y = 120;
LK.gui.top.addChild(healthTxt);
// Wave display
-var waveTxt = new Text2('Wave: 1/5 (0/10)', {
- size: 70,
+var waveTxt = new Text2('Chapter: 1/100 - Wave: 1/5 (0/10)', {
+ size: 60,
fill: 0x00FF00
});
waveTxt.anchor.set(0.5, 0);
waveTxt.y = 200;
@@ -285,10 +308,14 @@
LK.getSound('shoot').play();
};
// Spawn birds periodically
function spawnBird() {
- // Create random bird type (1-6)
- var randomBirdType = Math.floor(Math.random() * 6) + 1;
+ // Get available enemy types for current chapter
+ var chapterGroup = Math.min(Math.floor((currentChapter - 1) / 10), 9);
+ var availableEnemies = enemyTypesByChapter[chapterGroup];
+ // Create random bird type from available enemies for this chapter
+ var randomIndex = Math.floor(Math.random() * availableEnemies.length);
+ var randomBirdType = availableEnemies[randomIndex];
var bird = game.addChild(new Bird(randomBirdType));
// Random spawn from sides
if (Math.random() > 0.5) {
bird.x = -50;
@@ -307,11 +334,23 @@
if (!gameStarted) return;
// Check wave completion
if (birdsKilledThisWave >= birdsNeededPerWave[currentWave - 1]) {
if (currentWave >= maxWaves) {
- // All waves completed - player wins!
- LK.showYouWin();
- return;
+ // Chapter completed
+ if (currentChapter >= maxChapters) {
+ // All chapters completed - player wins!
+ LK.showYouWin();
+ return;
+ } else {
+ // Move to next chapter
+ currentChapter++;
+ currentWave = 1;
+ birdsKilledThisWave = 0;
+ waveStarted = false;
+ // Reset health for new chapter
+ health = 20;
+ healthTxt.setText('Health: ' + health);
+ }
} else {
// Move to next wave
currentWave++;
birdsKilledThisWave = 0;
@@ -333,9 +372,9 @@
}
}
}
// Update wave display
- waveTxt.setText('Wave: ' + currentWave + '/' + maxWaves + ' (' + birdsKilledThisWave + '/' + birdsNeededPerWave[currentWave - 1] + ')');
+ waveTxt.setText('Chapter: ' + currentChapter + '/' + maxChapters + ' - Wave: ' + currentWave + '/' + maxWaves + ' (' + birdsKilledThisWave + '/' + birdsNeededPerWave[currentWave - 1] + ')');
// Spawn birds based on current wave (higher waves spawn faster)
var spawnDelay = Math.max(15, 40 - currentWave * 5);
if (LK.ticks - lastBirdSpawn > spawnDelay) {
spawnBird();
uçan kuş. In-Game asset. 2d. High contrast. No shadows
havan. In-Game asset. 2d. High contrast. No shadows
mızrak ucu yukarı olsun.. In-Game asset. 2d. High contrast. No shadows uzun ve ince saplı.
uçan kaz. In-Game asset. 2d. High contrast. No shadows
bulut. In-Game asset. 2d. High contrast. No shadows
güneş. In-Game asset. 2d. High contrast. No shadows
çimen uzun otlar.. In-Game asset. 2d. High contrast. No shadows
ağaç çınar. In-Game asset. 2d. High contrast. No shadows
karlı büyük dağ.. In-Game asset. 2d. High contrast. No shadows
grii dağlar.. In-Game asset. 2d. High contrast. No shadows
ağaçlı, çimenli dağ.. In-Game asset. 2d. High contrast. No shadows