User prompt
Kaybedince restartButton ekrana gelsin ve basınca oyun yeniden başlasın
User prompt
Kaybedince ekranın yanlarında kırmızı bir effect çıksın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fındıklara değince ses çıkmasın
User prompt
Oyun 999 puan yapınca bitsin ve Oyunu oynadığınız için teşekkürler (Thank you for playing the game) ve altında povered by Tuğra Karakuş yazsın
User prompt
Oyun 999 puan yapınca bitsin ve Oyunu oynadığınız için teşekkürler (Thank you for playing the game) ve altında povered by Tuğra Karakuş yazsın
User prompt
999 puana ulaşınca ekranın ortasına firework resmi ve fireworksboom sesi gelsin
User prompt
Hata düzeltmesi yap
User prompt
Oyun 999 puana gelince bitsin ve 999 puanda victory sesi çalsın
User prompt
52 puana gelince victory sesi çalsın
User prompt
Oyun 52 puan yapınca bitsin ve Oyunu oynadığınız için teşekkürler (Thank you for playing the game) povered by Tuğra Karakuş yazsın
User prompt
Firework ve fireworksboom sesi 52 puana gelince çalsın
User prompt
Ve ekrana firework gelince fireworksboom sesi çalsın
User prompt
Oyun bitince ekrana 2 saniyeliğine firework resmi gelsin ortaya ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
0.5 saniye boyunca basmadığımda fly sesi çalsın
User prompt
1 saniye boyunca basmadığımdan fly sesi çalsın
User prompt
Kuş zıplama tuşuna basmadığımızda aşağı doğru inerken fly sesi çalsın tekrar zıpla dediğimde yani ekrana tıklayınca o ses dursun ekrana basmadığımdan 1.5 saniye boyunca basmazsam fly sesi çalsın ekrana tıkladığım zaman dursun
User prompt
Kuş pipe ve uppipe lara değmediği halde bazen kaybettin diyor bunu düzelt
User prompt
Uppipe ile pipe ların arasındaki mesafe birazcık azalsın
User prompt
Oyunun sonunda Oyunu oydağınız için teşekkürler (Thank you for playing game)/ORDU(52) yazısı çıksın ardından FINDIK KUŞU(HAZELNUT BİRD) diye büyük bir yazı ile altında povered by Tuğra Karakuş yazsın oyun bitsin sonra yeniden başlat tuşu çıksın
User prompt
Her fındığa değince 1 puan artsın
User prompt
Her fındık 1 puan olsun
User prompt
Puan sadece fındıklara değince artsın
User prompt
Start tuşuna basmadan kuş hareket etmesin
User prompt
Oyun hemen başlamasın oyunun başında start diye bir tuş gelsin ona basınca başlasın
User prompt
Kuşun hızı biraz daha fazla olsun ve render biraz artsın
/****
* 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 = 1.2;
self.flapPower = -16;
self.flap = function () {
self.velocity = self.flapPower;
LK.getSound('flap').play();
};
self.update = function () {
// Only move bird if game has started
if (!gameStarted) return;
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 = -6;
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 = 500; // Increased gap size for more spacing
self.gapY = 800 + Math.random() * 1000; // Random gap position
self.speed = -6;
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 (no scoring for pipes)
if (!self.scored && self.x < bird.x - 60) {
self.scored = true;
}
// 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 showStartButton = true;
var showEndScreen = false;
var showRestartButton = 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);
// Thank you message
var thankYouTxt = new Text2('Oyunu oynadığınız için teşekkürler / ORDU(52)', {
size: 80,
fill: 0xFFFFFF
});
thankYouTxt.anchor.set(0.5, 0.5);
thankYouTxt.alpha = 0;
LK.gui.center.addChild(thankYouTxt);
// Game title text
var gameTitleTxt = new Text2('FINDIK KUŞU (HAZELNUT BIRD)', {
size: 120,
fill: 0xFFD700
});
gameTitleTxt.anchor.set(0.5, 0.5);
gameTitleTxt.alpha = 0;
LK.gui.center.addChild(gameTitleTxt);
// Credit text
var creditTxt = new Text2('Powered by Tuğra Karakuş', {
size: 60,
fill: 0xC0C0C0
});
creditTxt.anchor.set(0.5, 0.5);
creditTxt.alpha = 0;
LK.gui.center.addChild(creditTxt);
// Restart button
var restartButton = LK.getAsset('restartButton', {
anchorX: 0.5,
anchorY: 0.5
});
restartButton.x = 1024;
restartButton.y = 2000;
restartButton.alpha = 0;
game.addChild(restartButton);
// Restart button text
var restartButtonTxt = new Text2('RESTART', {
size: 60,
fill: 0xFFFFFF
});
restartButtonTxt.anchor.set(0.5, 0.5);
restartButtonTxt.x = 1024;
restartButtonTxt.y = 2000;
restartButtonTxt.alpha = 0;
game.addChild(restartButtonTxt);
// Start button
var startButton = LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5
});
startButton.x = 1024;
startButton.y = 1366;
game.addChild(startButton);
// Start button text
var startButtonTxt = new Text2('START', {
size: 60,
fill: 0xFFFFFF
});
startButtonTxt.anchor.set(0.5, 0.5);
startButtonTxt.x = 1024;
startButtonTxt.y = 1366;
game.addChild(startButtonTxt);
// 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 end screen sequence after brief delay
LK.setTimeout(function () {
showEndScreen = true;
// Hide victory text
tween(victoryTxt, {
alpha: 0
}, {
duration: 500
});
// Show thank you message
thankYouTxt.y = 1000;
tween(thankYouTxt, {
alpha: 1
}, {
duration: 1000
});
// Show game title after 2 seconds
LK.setTimeout(function () {
gameTitleTxt.y = 1200;
tween(gameTitleTxt, {
alpha: 1
}, {
duration: 1000
});
// Show credit after 1 more second
LK.setTimeout(function () {
creditTxt.y = 1350;
tween(creditTxt, {
alpha: 1
}, {
duration: 1000
});
// Show restart button after 1 more second
LK.setTimeout(function () {
showRestartButton = true;
tween(restartButton, {
alpha: 1
}, {
duration: 500
});
tween(restartButtonTxt, {
alpha: 1
}, {
duration: 500
});
}, 1000);
}, 1000);
}, 2000);
}, 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 && showStartButton) {
// Check if start button was clicked
var buttonBounds = {
left: startButton.x - startButton.width / 2,
right: startButton.x + startButton.width / 2,
top: startButton.y - startButton.height / 2,
bottom: startButton.y + startButton.height / 2
};
if (x >= buttonBounds.left && x <= buttonBounds.right && y >= buttonBounds.top && y <= buttonBounds.bottom) {
gameStarted = true;
showStartButton = false;
startButton.alpha = 0;
startButtonTxt.alpha = 0;
}
}
if (showRestartButton) {
// Check if restart button was clicked
var restartBounds = {
left: restartButton.x - restartButton.width / 2,
right: restartButton.x + restartButton.width / 2,
top: restartButton.y - restartButton.height / 2,
bottom: restartButton.y + restartButton.height / 2
};
if (x >= restartBounds.left && x <= restartBounds.right && y >= restartBounds.top && y <= restartBounds.bottom) {
// Reset game
location.reload();
}
}
if (gameStarted && !gameWon) {
bird.flap();
}
};
game.update = function () {
if (!gameStarted || showStartButton) return;
// Spawn pipes
pipeTimer++;
if (pipeTimer >= 120) {
// Every 2 seconds at 60fps for faster rendering
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);
continue;
}
// Initialize collision tracking if not set
if (hazelnut.lastColliding === undefined) {
hazelnut.lastColliding = false;
}
// Check collision with bird - only score once per hazelnut
var currentColliding = bird.intersects(hazelnut);
if (!hazelnut.lastColliding && currentColliding) {
// First collision with this hazelnut
score++;
LK.setScore(score);
scoreTxt.setText(score);
LK.getSound('score').play();
hazelnut.destroy();
hazelnuts.splice(j, 1);
// Check for victory
if (score >= 52) {
triggerVictory();
}
continue;
}
// Update collision state
hazelnut.lastColliding = currentColliding;
}
// 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
@@ -130,8 +130,10 @@
var score = 0;
var gameStarted = false;
var gameWon = false;
var showStartButton = true;
+var showEndScreen = false;
+var showRestartButton = false;
var pipeTimer = 0;
var hazelnutTimer = 0;
var fireworkTimer = 0;
// Score display
@@ -148,8 +150,51 @@
});
victoryTxt.anchor.set(0.5, 0.5);
victoryTxt.alpha = 0;
LK.gui.center.addChild(victoryTxt);
+// Thank you message
+var thankYouTxt = new Text2('Oyunu oynadığınız için teşekkürler / ORDU(52)', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+thankYouTxt.anchor.set(0.5, 0.5);
+thankYouTxt.alpha = 0;
+LK.gui.center.addChild(thankYouTxt);
+// Game title text
+var gameTitleTxt = new Text2('FINDIK KUŞU (HAZELNUT BIRD)', {
+ size: 120,
+ fill: 0xFFD700
+});
+gameTitleTxt.anchor.set(0.5, 0.5);
+gameTitleTxt.alpha = 0;
+LK.gui.center.addChild(gameTitleTxt);
+// Credit text
+var creditTxt = new Text2('Powered by Tuğra Karakuş', {
+ size: 60,
+ fill: 0xC0C0C0
+});
+creditTxt.anchor.set(0.5, 0.5);
+creditTxt.alpha = 0;
+LK.gui.center.addChild(creditTxt);
+// Restart button
+var restartButton = LK.getAsset('restartButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+restartButton.x = 1024;
+restartButton.y = 2000;
+restartButton.alpha = 0;
+game.addChild(restartButton);
+// Restart button text
+var restartButtonTxt = new Text2('RESTART', {
+ size: 60,
+ fill: 0xFFFFFF
+});
+restartButtonTxt.anchor.set(0.5, 0.5);
+restartButtonTxt.x = 1024;
+restartButtonTxt.y = 2000;
+restartButtonTxt.alpha = 0;
+game.addChild(restartButtonTxt);
// Start button
var startButton = LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5
@@ -184,11 +229,56 @@
easing: tween.easeOut
});
// Start fireworks
fireworkTimer = 0;
- // Show you win after brief delay
+ // Show end screen sequence after brief delay
LK.setTimeout(function () {
- LK.showYouWin();
+ showEndScreen = true;
+ // Hide victory text
+ tween(victoryTxt, {
+ alpha: 0
+ }, {
+ duration: 500
+ });
+ // Show thank you message
+ thankYouTxt.y = 1000;
+ tween(thankYouTxt, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ // Show game title after 2 seconds
+ LK.setTimeout(function () {
+ gameTitleTxt.y = 1200;
+ tween(gameTitleTxt, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ // Show credit after 1 more second
+ LK.setTimeout(function () {
+ creditTxt.y = 1350;
+ tween(creditTxt, {
+ alpha: 1
+ }, {
+ duration: 1000
+ });
+ // Show restart button after 1 more second
+ LK.setTimeout(function () {
+ showRestartButton = true;
+ tween(restartButton, {
+ alpha: 1
+ }, {
+ duration: 500
+ });
+ tween(restartButtonTxt, {
+ alpha: 1
+ }, {
+ duration: 500
+ });
+ }, 1000);
+ }, 1000);
+ }, 2000);
}, 3000);
}
function createFirework() {
var firework = new Firework();
@@ -212,8 +302,21 @@
startButton.alpha = 0;
startButtonTxt.alpha = 0;
}
}
+ if (showRestartButton) {
+ // Check if restart button was clicked
+ var restartBounds = {
+ left: restartButton.x - restartButton.width / 2,
+ right: restartButton.x + restartButton.width / 2,
+ top: restartButton.y - restartButton.height / 2,
+ bottom: restartButton.y + restartButton.height / 2
+ };
+ if (x >= restartBounds.left && x <= restartBounds.right && y >= restartBounds.top && y <= restartBounds.bottom) {
+ // Reset game
+ location.reload();
+ }
+ }
if (gameStarted && !gameWon) {
bird.flap();
}
};
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