User prompt
Her 5. Dalgada boss arı gelsin tek bir büyük arı ve 15 mermi yemeden ölmesin
User prompt
1. Dalgada 15 arı gelsin sonraki dalgalarda 2 şer adet arılar artsın
User prompt
Her dalgada bir öncekinin 2 katı arı gelsin
User prompt
Daha fazla arı ve dalgalar arası geçiş sırasında bekleme süresi çok az olsun
User prompt
Arka plan müziği oluşturmama yardım et
User prompt
Arılar ekranın alt kısmına ulaşırsa oyun biter
User prompt
Power up çok daha nadir çıksın
User prompt
Mermiler biraz daha hızlı gitsin ama çok daha seyrek çıksın
User prompt
Arılar çok az geliyor daha zor bir oyun için başlangıçtan itibaren daha çok arı gelsin
User prompt
Çiçek yaması assetini sil. Mermi hızını yarı yarıya azaltalım
User prompt
Arka plan değiştirme tuşunu silelim ve onun yerine o tuşa basılınca tüm assetlerin değişeceği bir oyun yapalım
User prompt
arka planı değiştirebilmem için varlıklara ekler misin
Code edit (1 edits merged)
Please save this source code
User prompt
Robotic Ant vs Space Bees
Initial prompt
space invader tarzı bir oyun yapmak istiyorum. Ama bu oyunda karakterimiz robotik bir karınca olucak karşıdan gelen uzay gemileride arıya benzeyecek arka plan çimenlik olucak
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Ant = Container.expand(function () { var self = Container.call(this); var antGraphics = self.attachAsset('ant', { anchorX: 0.5, anchorY: 0.5 }); self.shootTimer = 0; self.shootDelay = 15; self.update = function () { self.shootTimer++; if (self.shootTimer >= self.shootDelay) { self.shootTimer = 0; fireAntBullet(); } }; return self; }); var AntBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('antBullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -8; self.update = function () { self.y += self.speed; }; return self; }); var Bee = Container.expand(function () { var self = Container.call(this); var beeGraphics = self.attachAsset('bee', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 2; self.horizontalSpeed = 1; self.direction = Math.random() > 0.5 ? 1 : -1; self.update = function () { self.y += self.speed; self.x += self.horizontalSpeed * self.direction; if (self.x <= 50 || self.x >= 1998) { self.direction *= -1; } }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var powerUpGraphics = self.attachAsset('powerUp', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.bobTimer = 0; self.update = function () { self.y += self.speed; self.bobTimer += 0.2; self.rotation = Math.sin(self.bobTimer) * 0.3; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x228b22 }); /**** * Game Code ****/ // Game variables var ant; var bees = []; var antBullets = []; var powerUps = []; var waveTimer = 0; var currentWave = 1; var beesPerWave = 5; var waveDelay = 300; var nextWaveTimer = 0; var dragNode = null; var gameRunning = true; // UI Elements var scoreTxt = new Text2('Score: 0', { size: 60, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var waveTxt = new Text2('Wave: 1', { size: 50, fill: 0xFFFF00 }); waveTxt.anchor.set(0, 0); waveTxt.x = 50; waveTxt.y = 100; LK.gui.topLeft.addChild(waveTxt); // Initialize ant ant = game.addChild(new Ant()); ant.x = 1024; ant.y = 2600; // Functions function fireAntBullet() { if (!gameRunning) return; var bullet = new AntBullet(); bullet.x = ant.x; bullet.y = ant.y - 40; antBullets.push(bullet); game.addChild(bullet); LK.getSound('shoot').play(); } function spawnBee() { var bee = new Bee(); bee.x = Math.random() * 1800 + 124; bee.y = -50; bee.speed = 1 + currentWave * 0.3; bees.push(bee); game.addChild(bee); } function spawnWave() { var beesToSpawn = beesPerWave + Math.floor(currentWave / 2); for (var i = 0; i < beesToSpawn; i++) { LK.setTimeout(function () { spawnBee(); }, i * 200); } } function spawnPowerUp(x, y) { if (Math.random() < 0.3) { var powerUp = new PowerUp(); powerUp.x = x; powerUp.y = y; powerUps.push(powerUp); game.addChild(powerUp); } } function handleMove(x, y, obj) { if (!gameRunning) return; if (dragNode) { dragNode.x = Math.max(50, Math.min(1998, x)); } } // Event handlers game.move = handleMove; game.down = function (x, y, obj) { if (!gameRunning) return; dragNode = ant; handleMove(x, y, obj); }; game.up = function (x, y, obj) { dragNode = null; }; // Start first wave spawnWave(); // Main game loop game.update = function () { if (!gameRunning) return; // Update ant bullets for (var i = antBullets.length - 1; i >= 0; i--) { var bullet = antBullets[i]; if (bullet.y < -50) { bullet.destroy(); antBullets.splice(i, 1); continue; } // Check collision with bees for (var j = bees.length - 1; j >= 0; j--) { var bee = bees[j]; if (bullet.intersects(bee)) { // Destroy bee and bullet LK.setScore(LK.getScore() + 10 * currentWave); scoreTxt.setText('Score: ' + LK.getScore()); spawnPowerUp(bee.x, bee.y); bee.destroy(); bees.splice(j, 1); bullet.destroy(); antBullets.splice(i, 1); LK.getSound('beeDestroy').play(); LK.effects.flashObject(bee, 0xffffff, 200); break; } } } // Update bees for (var i = bees.length - 1; i >= 0; i--) { var bee = bees[i]; // Check if bee reached bottom if (bee.y > 2732) { bee.destroy(); bees.splice(i, 1); continue; } // Check collision with ant if (bee.intersects(ant)) { gameRunning = false; LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); return; } } // Update power-ups for (var i = powerUps.length - 1; i >= 0; i--) { var powerUp = powerUps[i]; if (powerUp.y > 2732) { powerUp.destroy(); powerUps.splice(i, 1); continue; } // Check collision with ant if (powerUp.intersects(ant)) { LK.setScore(LK.getScore() + 50); scoreTxt.setText('Score: ' + LK.getScore()); ant.shootDelay = Math.max(5, ant.shootDelay - 2); powerUp.destroy(); powerUps.splice(i, 1); LK.getSound('powerUpCollect').play(); LK.effects.flashObject(ant, 0x00ff00, 300); } } // Wave management if (bees.length === 0) { nextWaveTimer++; if (nextWaveTimer >= waveDelay) { currentWave++; waveTxt.setText('Wave: ' + currentWave); nextWaveTimer = 0; spawnWave(); // Victory condition if (currentWave > 10) { gameRunning = false; LK.showYouWin(); return; } } } // Keep ant within bounds ant.x = Math.max(50, Math.min(1998, ant.x)); };
===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,249 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Ant = Container.expand(function () {
+ var self = Container.call(this);
+ var antGraphics = self.attachAsset('ant', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.shootTimer = 0;
+ self.shootDelay = 15;
+ self.update = function () {
+ self.shootTimer++;
+ if (self.shootTimer >= self.shootDelay) {
+ self.shootTimer = 0;
+ fireAntBullet();
+ }
+ };
+ return self;
+});
+var AntBullet = Container.expand(function () {
+ var self = Container.call(this);
+ var bulletGraphics = self.attachAsset('antBullet', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = -8;
+ self.update = function () {
+ self.y += self.speed;
+ };
+ return self;
+});
+var Bee = Container.expand(function () {
+ var self = Container.call(this);
+ var beeGraphics = self.attachAsset('bee', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 2;
+ self.horizontalSpeed = 1;
+ self.direction = Math.random() > 0.5 ? 1 : -1;
+ self.update = function () {
+ self.y += self.speed;
+ self.x += self.horizontalSpeed * self.direction;
+ if (self.x <= 50 || self.x >= 1998) {
+ self.direction *= -1;
+ }
+ };
+ return self;
+});
+var PowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ var powerUpGraphics = self.attachAsset('powerUp', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 3;
+ self.bobTimer = 0;
+ self.update = function () {
+ self.y += self.speed;
+ self.bobTimer += 0.2;
+ self.rotation = Math.sin(self.bobTimer) * 0.3;
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x228b22
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var ant;
+var bees = [];
+var antBullets = [];
+var powerUps = [];
+var waveTimer = 0;
+var currentWave = 1;
+var beesPerWave = 5;
+var waveDelay = 300;
+var nextWaveTimer = 0;
+var dragNode = null;
+var gameRunning = true;
+// UI Elements
+var scoreTxt = new Text2('Score: 0', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+var waveTxt = new Text2('Wave: 1', {
+ size: 50,
+ fill: 0xFFFF00
+});
+waveTxt.anchor.set(0, 0);
+waveTxt.x = 50;
+waveTxt.y = 100;
+LK.gui.topLeft.addChild(waveTxt);
+// Initialize ant
+ant = game.addChild(new Ant());
+ant.x = 1024;
+ant.y = 2600;
+// Functions
+function fireAntBullet() {
+ if (!gameRunning) return;
+ var bullet = new AntBullet();
+ bullet.x = ant.x;
+ bullet.y = ant.y - 40;
+ antBullets.push(bullet);
+ game.addChild(bullet);
+ LK.getSound('shoot').play();
+}
+function spawnBee() {
+ var bee = new Bee();
+ bee.x = Math.random() * 1800 + 124;
+ bee.y = -50;
+ bee.speed = 1 + currentWave * 0.3;
+ bees.push(bee);
+ game.addChild(bee);
+}
+function spawnWave() {
+ var beesToSpawn = beesPerWave + Math.floor(currentWave / 2);
+ for (var i = 0; i < beesToSpawn; i++) {
+ LK.setTimeout(function () {
+ spawnBee();
+ }, i * 200);
+ }
+}
+function spawnPowerUp(x, y) {
+ if (Math.random() < 0.3) {
+ var powerUp = new PowerUp();
+ powerUp.x = x;
+ powerUp.y = y;
+ powerUps.push(powerUp);
+ game.addChild(powerUp);
+ }
+}
+function handleMove(x, y, obj) {
+ if (!gameRunning) return;
+ if (dragNode) {
+ dragNode.x = Math.max(50, Math.min(1998, x));
+ }
+}
+// Event handlers
+game.move = handleMove;
+game.down = function (x, y, obj) {
+ if (!gameRunning) return;
+ dragNode = ant;
+ handleMove(x, y, obj);
+};
+game.up = function (x, y, obj) {
+ dragNode = null;
+};
+// Start first wave
+spawnWave();
+// Main game loop
+game.update = function () {
+ if (!gameRunning) return;
+ // Update ant bullets
+ for (var i = antBullets.length - 1; i >= 0; i--) {
+ var bullet = antBullets[i];
+ if (bullet.y < -50) {
+ bullet.destroy();
+ antBullets.splice(i, 1);
+ continue;
+ }
+ // Check collision with bees
+ for (var j = bees.length - 1; j >= 0; j--) {
+ var bee = bees[j];
+ if (bullet.intersects(bee)) {
+ // Destroy bee and bullet
+ LK.setScore(LK.getScore() + 10 * currentWave);
+ scoreTxt.setText('Score: ' + LK.getScore());
+ spawnPowerUp(bee.x, bee.y);
+ bee.destroy();
+ bees.splice(j, 1);
+ bullet.destroy();
+ antBullets.splice(i, 1);
+ LK.getSound('beeDestroy').play();
+ LK.effects.flashObject(bee, 0xffffff, 200);
+ break;
+ }
+ }
+ }
+ // Update bees
+ for (var i = bees.length - 1; i >= 0; i--) {
+ var bee = bees[i];
+ // Check if bee reached bottom
+ if (bee.y > 2732) {
+ bee.destroy();
+ bees.splice(i, 1);
+ continue;
+ }
+ // Check collision with ant
+ if (bee.intersects(ant)) {
+ gameRunning = false;
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ return;
+ }
+ }
+ // Update power-ups
+ for (var i = powerUps.length - 1; i >= 0; i--) {
+ var powerUp = powerUps[i];
+ if (powerUp.y > 2732) {
+ powerUp.destroy();
+ powerUps.splice(i, 1);
+ continue;
+ }
+ // Check collision with ant
+ if (powerUp.intersects(ant)) {
+ LK.setScore(LK.getScore() + 50);
+ scoreTxt.setText('Score: ' + LK.getScore());
+ ant.shootDelay = Math.max(5, ant.shootDelay - 2);
+ powerUp.destroy();
+ powerUps.splice(i, 1);
+ LK.getSound('powerUpCollect').play();
+ LK.effects.flashObject(ant, 0x00ff00, 300);
+ }
+ }
+ // Wave management
+ if (bees.length === 0) {
+ nextWaveTimer++;
+ if (nextWaveTimer >= waveDelay) {
+ currentWave++;
+ waveTxt.setText('Wave: ' + currentWave);
+ nextWaveTimer = 0;
+ spawnWave();
+ // Victory condition
+ if (currentWave > 10) {
+ gameRunning = false;
+ LK.showYouWin();
+ return;
+ }
+ }
+ }
+ // Keep ant within bounds
+ ant.x = Math.max(50, Math.min(1998, ant.x));
+};
\ No newline at end of file
siyah sarı renki arı. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Dik duran robotik bir karınca. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
BAL PETEĞİ. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
MAVİ BİR SÜMÜK. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat