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
User prompt
her kuş 5 puan olsun.her dalga 100 puanda değişsin.
User prompt
her atak 100 hedef olsun
User prompt
100 level olsun.Her level 5 atak olsun.
User prompt
mermi hızı iki kat artsın
User prompt
kule atışını yarıya düşür.
User prompt
arka ekran rengi ayarla
User prompt
20 canımız olsun
User prompt
kuşlar 4 katı gelsin
User prompt
her 100 skorda namlu adedi ve mermiler çoğalsın
User prompt
mermiler 4 kat hızlansın
User prompt
6 farklı kuş türü olsun.
User prompt
uçan kuşları silahla vurma oyunu yap
User prompt
Compilation error[L15]: Plugins failed to load.clen
Code edit (1 edits merged)
Please save this source code
User prompt
Modern Commander: Base Defense
Initial prompt
modern commander tarzı bir oyun olsun
/****
* 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: 10,
color: 0xffffff
},
2: {
speedMultiplier: 0.7,
bounceChance: 0.9,
points: 15,
color: 0x8B4513
},
// Eagle - slower, more points
3: {
speedMultiplier: 1.5,
bounceChance: 0.6,
points: 20,
color: 0x654321
},
// Sparrow - fast, bonus points
4: {
speedMultiplier: 0.5,
bounceChance: 0.95,
points: 25,
color: 0x2F4F4F
},
// Hawk - slow, high points
5: {
speedMultiplier: 2.0,
bounceChance: 0.4,
points: 30,
color: 0xFF6347
},
// Robin - very fast, highest points
6: {
speedMultiplier: 1.2,
bounceChance: 0.7,
points: 12,
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: 0x000000
});
/****
* 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;
// 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);
// 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() {
// Create random bird type (1-6)
var randomBirdType = Math.floor(Math.random() * 6) + 1;
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 for score milestones every 100 points
var currentScore = LK.getScore();
var currentCheckpoint = Math.floor(currentScore / 100) * 100;
if (currentCheckpoint > lastScoreCheckpoint && currentCheckpoint > 0) {
lastScoreCheckpoint = currentCheckpoint;
// Increase gun count every 100 points
if (guns.length < 5) {
// Limit to 5 guns max
gunCount++;
guns.push(createGun(guns.length));
}
// Increase bullets per shot every 100 points
if (bulletsPerShot < 3) {
// Limit to 3 bullets per shot max
bulletsPerShot++;
}
}
// Spawn birds
if (LK.ticks - lastBirdSpawn > 30) {
spawnBird();
lastBirdSpawn = LK.ticks;
}
// 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 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! Use bird-specific points
LK.setScore(LK.getScore() + bird.points);
scoreTxt.setText('Score: ' + LK.getScore());
// 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
@@ -131,8 +131,9 @@
var gameStarted = false;
var bulletsPerShot = 1;
var gunCount = 1;
var lastScoreCheckpoint = 0;
+var health = 20;
// Create initial gun at bottom center
function createGun(index) {
var gun = game.addChild(new Gun());
var spacing = 2048 / (gunCount + 1);
@@ -148,8 +149,16 @@
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);
// Instructions
var instructionTxt = new Text2('Tap to aim and shoot flying birds!', {
size: 60,
fill: 0xFFFF00
@@ -240,17 +249,29 @@
}
// Update and check birds
for (var i = birds.length - 1; i >= 0; i--) {
var bird = birds[i];
- // Remove birds that flew off screen
+ // 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 and check bullets
uçan kuş. In-Game asset. 2d. High contrast. No shadows
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
tüfek saçması.. In-Game asset. 2d. High contrast. No shadows
beyaz kaz tüyü.. In-Game asset. 2d. High contrast. No shadows
kamuflaj giymiş avcı ayakta yukarıya ateş ediyor .gerçek fotoğraf.. In-Game asset. 2d. High contrast. No shadows sırtı bize dönük olsun