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 = 350; // Decreased gap size for less 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
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 >= 999) {
LK.getSound('victory').play();
// Create firework at screen center
var centerFirework = new Firework();
centerFirework.x = 1024; // Center X of screen
centerFirework.y = 1366; // Center Y of screen
fireworks.push(centerFirework);
game.addChild(centerFirework);
LK.getSound('Fireworksboom').play();
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 showStartButton = true;
var pipeTimer = 0;
var hazelnutTimer = 0;
var fireworkTimer = 0;
var lastTouchTime = 0;
var flySoundPlaying = false;
// 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('TEBRIKLER! 999 PUAN!', {
size: 150,
fill: 0x800080
});
victoryTxt.anchor.set(0.5, 0.5);
victoryTxt.alpha = 0;
LK.gui.center.addChild(victoryTxt);
// Thank you text
var thankYouTxt = new Text2('Oyunu oynadığınız için teşekkürler\n(Thank you for playing the game)', {
size: 80,
fill: 0xFFFFFF
});
thankYouTxt.anchor.set(0.5, 0.5);
thankYouTxt.alpha = 0;
LK.gui.center.addChild(thankYouTxt);
// Powered by text
var poweredByTxt = new Text2('Powered by Tuğra Karakuş', {
size: 60,
fill: 0xCCCCCC
});
poweredByTxt.anchor.set(0.5, 0.5);
poweredByTxt.alpha = 0;
LK.gui.center.addChild(poweredByTxt);
// 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;
gameStarted = false; // Stop the game
// Show victory text with animation
tween(victoryTxt, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut
});
// Show thank you text after victory text
LK.setTimeout(function () {
thankYouTxt.y = LK.gui.center.y - 100;
tween(thankYouTxt, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut
});
}, 1500);
// Show powered by text after thank you text
LK.setTimeout(function () {
poweredByTxt.y = LK.gui.center.y + 150;
tween(poweredByTxt, {
alpha: 1
}, {
duration: 1000,
easing: tween.easeOut
});
}, 2500);
// Start fireworks
fireworkTimer = 0;
// Show you win after displaying all messages
LK.setTimeout(function () {
LK.showYouWin();
}, 6000);
}
function createFirework() {
var firework = new Firework();
firework.x = Math.random() * 2048;
firework.y = Math.random() * 2732;
fireworks.push(firework);
game.addChild(firework);
LK.getSound('Fireworksboom').play();
}
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 (gameStarted && !gameWon) {
// Update last touch time and stop fly sound
lastTouchTime = LK.ticks;
if (flySoundPlaying) {
LK.getSound('fly').stop();
flySoundPlaying = false;
}
bird.flap();
}
};
game.update = function () {
if (!gameStarted || showStartButton) return;
// Handle fly sound when bird is falling
if (gameStarted && !gameWon) {
var timeSinceLastTouch = (LK.ticks - lastTouchTime) / 60; // Convert to seconds
if (timeSinceLastTouch >= 0.5 && !flySoundPlaying && bird.velocity > 0) {
LK.getSound('fly').play();
flySoundPlaying = true;
}
}
// 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 - check individual pipe parts
var upperPipe = pipe.children[0]; // First child is upper pipe
var lowerPipe = pipe.children[1]; // Second child is lower pipe
if (bird.intersects(upperPipe) || bird.intersects(lowerPipe)) {
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('score').play();
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
@@ -159,10 +159,10 @@
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Victory text
-var victoryTxt = new Text2('FINDIK KUŞU(999)', {
- size: 200,
+var victoryTxt = new Text2('TEBRIKLER! 999 PUAN!', {
+ size: 150,
fill: 0x800080
});
victoryTxt.anchor.set(0.5, 0.5);
victoryTxt.alpha = 0;
@@ -208,8 +208,9 @@
scoreTxt.setText('0');
LK.setScore(0);
function triggerVictory() {
gameWon = true;
+ gameStarted = false; // Stop the game
// Show victory text with animation
tween(victoryTxt, {
alpha: 1
}, {
@@ -217,9 +218,9 @@
easing: tween.easeOut
});
// Show thank you text after victory text
LK.setTimeout(function () {
- thankYouTxt.y = LK.gui.center.y - 200;
+ thankYouTxt.y = LK.gui.center.y - 100;
tween(thankYouTxt, {
alpha: 1
}, {
duration: 1000,
@@ -227,9 +228,9 @@
});
}, 1500);
// Show powered by text after thank you text
LK.setTimeout(function () {
- poweredByTxt.y = LK.gui.center.y + 200;
+ poweredByTxt.y = LK.gui.center.y + 150;
tween(poweredByTxt, {
alpha: 1
}, {
duration: 1000,
@@ -237,12 +238,12 @@
});
}, 2500);
// Start fireworks
fireworkTimer = 0;
- // Show you win after brief delay
+ // Show you win after displaying all messages
LK.setTimeout(function () {
LK.showYouWin();
- }, 5000);
+ }, 6000);
}
function createFirework() {
var firework = new Firework();
firework.x = Math.random() * 2048;
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