User prompt
Fındıklara değince bir puan toplama sesi çıksın ve fındıklar kaybolsun
User prompt
Hem pipe ların hemde uppipe ların aralarında biraz daha boşluk olsun her yerde değil aralarda olsun
User prompt
Uppipe lar oyun alanının en üstünde olsun diğer Green pipe lar ile karşılıklı olsun ve aralarında kalan boşlukta fındıklar olsun
User prompt
Borular birleşik olmasın
User prompt
Altta olan borular gibi üstte de arada boşluk kalacak şekilde karşılıklı yeşil borular olsun oyun alanını en üstünde
User prompt
Simetrik olan boruların üstte olanlar oyun alnının en üstünde dursun ve oyun alanını önceki hali gibi genişlet
User prompt
Üstteki borular oyun alanının üstünde olsun ve diğer borulara değmesin fındıklar hem üst hem de alttaki boruların ortasında kalan boşluğa yerleşsin
User prompt
Fındıklar dedikten sonra bir puan alma sesi çıksın ve fındıklar yok olsun yeşil borular bir yerde bir üstte simetrik şekilde olsun fındıklar da boruların arasında kalsın ama borular neredeyse her yerde olsun altlı üstlü simetrik bir şekilde aynı flappy bird deki gibi olsun borular ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Yeşil borular hem yerde hem de üstte dikey bir şekilde dursun üsttekileri başı aşağı doğru baksın
User prompt
Oyundaki yeşil borular yerde dikey bir şekilde olsun ve oyun alanı daha dar olsun
User prompt
Oyunun adını Fındık Kuşu (Hazelnut Bird) olarak değiştir
User prompt
Oyunu başlat
Code edit (1 edits merged)
Please save this source code
User prompt
Fındık Ordusu (Hazelnut Army)
Initial prompt
Flappy bird gibi neredeyse aynısını yap 52 de oyun bitsin ve oyunun sonunda havai fişekler çıksın VE ORDU(52) diye büyük mor renkli bir yazı gelsin etrafta fındık resimleri olsun bölüm sonunda
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Bird = Container.expand(function () {
var self = Container.call(this);
var birdGraphics = self.attachAsset('bird', {
anchorX: 0.5,
anchorY: 0.5
});
self.velocity = 0;
self.gravity = 0.8;
self.flapPower = -12;
self.flap = function () {
self.velocity = self.flapPower;
LK.getSound('flap').play();
};
self.update = function () {
self.velocity += self.gravity;
self.y += self.velocity;
// Rotate bird based on velocity
birdGraphics.rotation = Math.max(-0.5, Math.min(0.5, self.velocity * 0.05));
// Keep bird within screen bounds
if (self.y < 0) {
self.y = 0;
self.velocity = 0;
}
if (self.y > 2732) {
self.y = 2732;
self.velocity = 0;
}
};
return self;
});
var Firework = Container.expand(function () {
var self = Container.call(this);
var fireworkGraphics = self.attachAsset('firework', {
anchorX: 0.5,
anchorY: 0.5
});
self.lifetime = 0;
self.maxLifetime = 60;
self.velocityX = (Math.random() - 0.5) * 8;
self.velocityY = (Math.random() - 0.5) * 8;
self.update = function () {
self.x += self.velocityX;
self.y += self.velocityY;
self.lifetime++;
// Fade out over time
fireworkGraphics.alpha = 1 - self.lifetime / self.maxLifetime;
// Remove when expired
if (self.lifetime >= self.maxLifetime) {
self.toDestroy = true;
}
};
return self;
});
var Hazelnut = Container.expand(function () {
var self = Container.call(this);
var hazelnutGraphics = self.attachAsset('hazelnut', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -4;
self.rotationSpeed = 0.1;
self.update = function () {
self.x += self.speed;
hazelnutGraphics.rotation += self.rotationSpeed;
// Remove hazelnut when off screen
if (self.x < -100) {
self.toDestroy = true;
}
};
return self;
});
var Pipe = Container.expand(function () {
var self = Container.call(this);
self.gapSize = 300;
self.gapY = 800 + Math.random() * 1000; // Random gap position
self.speed = -4;
self.scored = false;
// Upper pipe at top of screen
var upperPipe = self.attachAsset('Uppipe', {
anchorX: 0.5,
anchorY: 0
});
upperPipe.y = 0; // Position at top of screen
upperPipe.scaleY = self.gapY / 2400; // Scale to reach gap start
// Lower pipe at bottom of screen
var lowerPipe = self.attachAsset('pipe', {
anchorX: 0.5,
anchorY: 1
});
lowerPipe.y = 2732; // Position at bottom of screen
lowerPipe.scaleY = (2732 - self.gapY - self.gapSize) / 2400; // Scale to reach gap end
self.update = function () {
self.x += self.speed;
// Check if bird has passed this pipe
if (!self.scored && self.x < bird.x - 60) {
self.scored = true;
score++;
LK.setScore(score);
scoreTxt.setText(score);
LK.getSound('score').play();
// Check for victory
if (score >= 52) {
triggerVictory();
}
}
// Remove pipe when off screen
if (self.x < -200) {
self.toDestroy = true;
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
var bird;
var pipes = [];
var hazelnuts = [];
var fireworks = [];
var score = 0;
var gameStarted = false;
var gameWon = false;
var pipeTimer = 0;
var hazelnutTimer = 0;
var fireworkTimer = 0;
// Score display
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Victory text
var victoryTxt = new Text2('FINDIK KUŞU(52)', {
size: 200,
fill: 0x800080
});
victoryTxt.anchor.set(0.5, 0.5);
victoryTxt.alpha = 0;
LK.gui.center.addChild(victoryTxt);
// Initialize bird
bird = game.addChild(new Bird());
bird.x = 300;
bird.y = 1366;
// Initialize score display
scoreTxt.setText('0');
LK.setScore(0);
function triggerVictory() {
gameWon = true;
LK.getSound('victory').play();
// Show victory text with animation
tween(victoryTxt, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut
});
// Start fireworks
fireworkTimer = 0;
// Show you win after brief delay
LK.setTimeout(function () {
LK.showYouWin();
}, 3000);
}
function createFirework() {
var firework = new Firework();
firework.x = Math.random() * 2048;
firework.y = Math.random() * 2732;
fireworks.push(firework);
game.addChild(firework);
}
game.down = function (x, y, obj) {
if (!gameStarted) {
gameStarted = true;
}
if (!gameWon) {
bird.flap();
}
};
game.update = function () {
if (!gameStarted) return;
// Spawn pipes
pipeTimer++;
if (pipeTimer >= 120) {
// Every 2 seconds at 60fps
var pipe = new Pipe();
pipe.x = 1800;
pipes.push(pipe);
game.addChild(pipe);
pipeTimer = 0;
}
// Spawn hazelnuts in pipe gaps
if (pipes.length > 0) {
var latestPipe = pipes[pipes.length - 1];
if (latestPipe.x < 1600 && latestPipe.x > 1400) {
// Spawn hazelnut in the gap of the latest pipe
var hazelnut = new Hazelnut();
hazelnut.x = latestPipe.x;
hazelnut.y = latestPipe.gapY + latestPipe.gapSize / 2;
hazelnuts.push(hazelnut);
game.addChild(hazelnut);
}
}
// Handle fireworks after victory
if (gameWon) {
fireworkTimer++;
if (fireworkTimer % 10 === 0) {
// Create firework every 10 frames
createFirework();
}
}
// Update and check collisions with pipes
for (var i = pipes.length - 1; i >= 0; i--) {
var pipe = pipes[i];
if (pipe.toDestroy) {
pipe.destroy();
pipes.splice(i, 1);
continue;
}
// Check collision with bird using intersects
if (bird.intersects(pipe)) {
LK.showGameOver();
return;
}
}
// Update hazelnuts
for (var j = hazelnuts.length - 1; j >= 0; j--) {
var hazelnut = hazelnuts[j];
if (hazelnut.toDestroy) {
hazelnut.destroy();
hazelnuts.splice(j, 1);
}
}
// Update fireworks
for (var k = fireworks.length - 1; k >= 0; k--) {
var firework = fireworks[k];
if (firework.toDestroy) {
firework.destroy();
fireworks.splice(k, 1);
}
}
// Check if bird hits ground or ceiling
if (bird.y <= 0 || bird.y >= 2732) {
LK.showGameOver();
}
}; ===================================================================
--- original.js
+++ change.js
@@ -35,42 +35,8 @@
}
};
return self;
});
-var BottomPipe = Container.expand(function () {
- var self = Container.call(this);
- self.gapCenter = 800 + Math.random() * 1500; // Expanded random gap center position
- self.gapSize = 350;
- self.speed = -4;
- self.scored = false;
- // Bottom pipe
- var bottomPipe = self.attachAsset('pipe', {
- anchorX: 0.5,
- anchorY: 0
- });
- bottomPipe.y = self.gapCenter + self.gapSize / 2;
- bottomPipe.scaleY = (2732 - bottomPipe.y) / 600;
- self.update = function () {
- self.x += self.speed;
- // Check if bird has passed this pipe
- if (!self.scored && self.x < bird.x - 60) {
- self.scored = true;
- score++;
- LK.setScore(score);
- scoreTxt.setText(score);
- LK.getSound('score').play();
- // Check for victory
- if (score >= 52) {
- triggerVictory();
- }
- }
- // Remove pipe when off screen
- if (self.x < -200) {
- self.toDestroy = true;
- }
- };
- return self;
-});
var Firework = Container.expand(function () {
var self = Container.call(this);
var fireworkGraphics = self.attachAsset('firework', {
anchorX: 0.5,
@@ -110,23 +76,42 @@
}
};
return self;
});
-var TopPipe = Container.expand(function () {
+var Pipe = Container.expand(function () {
var self = Container.call(this);
- self.gapCenter = 800 + Math.random() * 1500; // Expanded random gap center position
- self.gapSize = 350;
+ self.gapSize = 300;
+ self.gapY = 800 + Math.random() * 1000; // Random gap position
self.speed = -4;
- // Top pipe (flipped) - positioned with gap at top
- var topPipe = self.attachAsset('pipe', {
+ self.scored = false;
+ // Upper pipe at top of screen
+ var upperPipe = self.attachAsset('Uppipe', {
anchorX: 0.5,
+ anchorY: 0
+ });
+ upperPipe.y = 0; // Position at top of screen
+ upperPipe.scaleY = self.gapY / 2400; // Scale to reach gap start
+ // Lower pipe at bottom of screen
+ var lowerPipe = self.attachAsset('pipe', {
+ anchorX: 0.5,
anchorY: 1
});
- topPipe.y = self.gapCenter - self.gapSize / 2;
- topPipe.scaleY = (self.gapCenter - self.gapSize / 2) / 600;
- topPipe.rotation = Math.PI; // Rotate 180 degrees to point downward
+ lowerPipe.y = 2732; // Position at bottom of screen
+ lowerPipe.scaleY = (2732 - self.gapY - self.gapSize) / 2400; // Scale to reach gap end
self.update = function () {
self.x += self.speed;
+ // Check if bird has passed this pipe
+ if (!self.scored && self.x < bird.x - 60) {
+ self.scored = true;
+ score++;
+ LK.setScore(score);
+ scoreTxt.setText(score);
+ LK.getSound('score').play();
+ // Check for victory
+ if (score >= 52) {
+ triggerVictory();
+ }
+ }
// Remove pipe when off screen
if (self.x < -200) {
self.toDestroy = true;
}
@@ -144,10 +129,9 @@
/****
* Game Code
****/
var bird;
-var bottomPipes = [];
-var topPipes = [];
+var pipes = [];
var hazelnuts = [];
var fireworks = [];
var score = 0;
var gameStarted = false;
@@ -171,9 +155,9 @@
victoryTxt.alpha = 0;
LK.gui.center.addChild(victoryTxt);
// Initialize bird
bird = game.addChild(new Bird());
-bird.x = 400;
+bird.x = 300;
bird.y = 1366;
// Initialize score display
scoreTxt.setText('0');
LK.setScore(0);
@@ -212,34 +196,27 @@
game.update = function () {
if (!gameStarted) return;
// Spawn pipes
pipeTimer++;
- if (pipeTimer >= 60) {
- // Every 1 second at 60fps - more frequent
- var gapCenter = 800 + Math.random() * 1500;
- var bottomPipe = new BottomPipe();
- bottomPipe.x = 2400;
- bottomPipe.gapCenter = gapCenter;
- bottomPipes.push(bottomPipe);
- game.addChild(bottomPipe);
- var topPipe = new TopPipe();
- topPipe.x = 2400;
- topPipe.gapCenter = gapCenter;
- topPipes.push(topPipe);
- game.addChild(topPipe);
+ if (pipeTimer >= 120) {
+ // Every 2 seconds at 60fps
+ var pipe = new Pipe();
+ pipe.x = 1800;
+ pipes.push(pipe);
+ game.addChild(pipe);
pipeTimer = 0;
}
- // Spawn hazelnuts occasionally in pipe gaps
- hazelnutTimer++;
- if (hazelnutTimer >= 120 && bottomPipes.length > 0) {
- // Every 2 seconds, place hazelnut in most recent pipe gap
- var lastPipe = bottomPipes[bottomPipes.length - 1];
- var hazelnut = new Hazelnut();
- hazelnut.x = lastPipe.x + 60; // Slightly ahead of pipe
- hazelnut.y = lastPipe.gapCenter; // In the gap center
- hazelnuts.push(hazelnut);
- game.addChild(hazelnut);
- hazelnutTimer = 0;
+ // Spawn hazelnuts in pipe gaps
+ if (pipes.length > 0) {
+ var latestPipe = pipes[pipes.length - 1];
+ if (latestPipe.x < 1600 && latestPipe.x > 1400) {
+ // Spawn hazelnut in the gap of the latest pipe
+ var hazelnut = new Hazelnut();
+ hazelnut.x = latestPipe.x;
+ hazelnut.y = latestPipe.gapY + latestPipe.gapSize / 2;
+ hazelnuts.push(hazelnut);
+ game.addChild(hazelnut);
+ }
}
// Handle fireworks after victory
if (gameWon) {
fireworkTimer++;
@@ -247,50 +224,29 @@
// Create firework every 10 frames
createFirework();
}
}
- // Update and check collisions with bottom pipes
- for (var i = bottomPipes.length - 1; i >= 0; i--) {
- var pipe = bottomPipes[i];
+ // Update and check collisions with pipes
+ for (var i = pipes.length - 1; i >= 0; i--) {
+ var pipe = pipes[i];
if (pipe.toDestroy) {
pipe.destroy();
- bottomPipes.splice(i, 1);
+ pipes.splice(i, 1);
continue;
}
// Check collision with bird using intersects
if (bird.intersects(pipe)) {
LK.showGameOver();
return;
}
}
- // Update and check collisions with top pipes
- for (var i = topPipes.length - 1; i >= 0; i--) {
- var pipe = topPipes[i];
- if (pipe.toDestroy) {
- pipe.destroy();
- topPipes.splice(i, 1);
- continue;
- }
- // Check collision with bird using intersects
- if (bird.intersects(pipe)) {
- LK.showGameOver();
- return;
- }
- }
// Update hazelnuts
for (var j = hazelnuts.length - 1; j >= 0; j--) {
var hazelnut = hazelnuts[j];
if (hazelnut.toDestroy) {
hazelnut.destroy();
hazelnuts.splice(j, 1);
- continue;
}
- // Check collision with bird
- if (bird.intersects(hazelnut)) {
- LK.getSound('collect').play();
- hazelnut.destroy();
- hazelnuts.splice(j, 1);
- }
}
// Update fireworks
for (var k = fireworks.length - 1; k >= 0; k--) {
var firework = fireworks[k];
Fireworks. In-Game asset. 2d. High contrast. No shadows
Green pipe. In-Game asset. 2d. High contrast. No shadows
hazelnut. In-Game asset. 2d. High contrast. No shadows
Start button. In-Game asset. 2d. High contrast. No shadows
Restart button. In-Game asset. 2d. High contrast. No shadows
Top şeklinde flappy bird gibi bir kuş çiz ama mor renkli. In-Game asset. 2d. High contrast. No shadows. flapptbird