User prompt
After score even 50 make sure none of the pipes shouldnt be impossible to pass maybe we can do %1 easier after 50 till 50 everything is ok
User prompt
Start my score from 45 for test purposes
User prompt
make %4-5 less extreme for make vertical extreme in later on the game score around 50+ make %2-3 more extreme
User prompt
Biraz daha arttır gap position randomness make vertical movement little bit more extreme
User prompt
Pipe spawnını aniden en alttan en üste çekme biraz daha yakınlaştır kuş zor olsada yetişebilsin ama çokta kolaylaştırma
User prompt
Pipe spawnını biraz daha zorlaştır şuan çok kolay
User prompt
Pipeların boşluğunu yetişebileceğimiz şekilde derecelendir bir anda en yüksekten en aşağıya geçişlerde bazen geçmek imkansız olabiliyor bunları kuşun hızına göre ölç ayarla
User prompt
Her 30 puanda bir arka plan asseti değişsin toplamda 3 farklı asset olabilir
User prompt
Pipeların üstleri ve altları tamamen ekranın üstüne altına gelsin boşluk sadece pipeların arasında kalsın
User prompt
Pipelar tamamen oyun ekranına sığdırılsın alttan ve üstten boşluk kalmasın
User prompt
Pipe'ların içinden geçiş kolaylaşması adına aralıkları genişlesin
Code edit (1 edits merged)
Please save this source code
User prompt
Flappy Bird - Tap to Fly
Initial prompt
Flappy Bird oyunu
/****
* 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.5;
self.flapPower = -10;
self.maxFallSpeed = 10;
self.rotation = 0;
self.flap = function () {
self.velocity = self.flapPower;
LK.getSound('flap').play();
// Animate bird flap
tween(birdGraphics, {
rotation: -0.3
}, {
duration: 150,
easing: tween.easeOut
});
tween(birdGraphics, {
rotation: 0
}, {
duration: 300,
easing: tween.easeInOut
});
};
self.update = function () {
// Apply gravity
self.velocity += self.gravity;
// Limit fall speed
if (self.velocity > self.maxFallSpeed) {
self.velocity = self.maxFallSpeed;
}
// Update position
self.y += self.velocity;
// Rotate bird based on velocity
var targetRotation = Math.min(Math.PI / 4, self.velocity * 0.05);
birdGraphics.rotation = targetRotation;
};
return self;
});
var Pipe = Container.expand(function () {
var self = Container.call(this);
self.speed = -4;
self.gapSize = 400;
self.passed = false;
var topPipe = self.attachAsset('pipeTop', {
anchorX: 0.5,
anchorY: 1
});
var bottomPipe = self.attachAsset('pipeBottom', {
anchorX: 0.5,
anchorY: 0
});
self.setGapPosition = function (gapY) {
topPipe.y = gapY - self.gapSize / 2;
bottomPipe.y = gapY + self.gapSize / 2;
};
self.update = function () {
self.x += self.speed;
};
self.checkCollision = function (bird) {
var birdBounds = {
x: bird.x - 30,
y: bird.y - 30,
width: 60,
height: 60
};
var topPipeBounds = {
x: self.x - 60,
y: topPipe.y - 800,
width: 120,
height: 800
};
var bottomPipeBounds = {
x: self.x - 60,
y: bottomPipe.y,
width: 120,
height: 800
};
return self.intersectsBounds(birdBounds, topPipeBounds) || self.intersectsBounds(birdBounds, bottomPipeBounds);
};
self.intersectsBounds = function (a, b) {
return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game state
var gameStarted = false;
var bird;
var pipes = [];
var ground;
var pipeSpawnTimer = 0;
var pipeSpawnDelay = 120; // 2 seconds at 60fps
// Create bird
bird = game.addChild(new Bird());
bird.x = 400;
bird.y = 1366; // Center of screen
// Create ground
ground = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 0
}));
ground.x = 0;
ground.y = 2732 - 100;
// Create score display
var scoreTxt = new Text2('0', {
size: 120,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
scoreTxt.y = 100;
// Create instruction text
var instructionTxt = new Text2('TAP TO FLY', {
size: 80,
fill: 0xFFFFFF
});
instructionTxt.anchor.set(0.5, 0.5);
game.addChild(instructionTxt);
instructionTxt.x = 1024;
instructionTxt.y = 800;
// Spawn pipe function
function spawnPipe() {
var pipe = new Pipe();
var minY = 400;
var maxY = 2332;
var gapY = minY + Math.random() * (maxY - minY);
pipe.setGapPosition(gapY);
pipe.x = 2048 + 60;
pipes.push(pipe);
game.addChild(pipe);
}
// Game input handling
game.down = function (x, y, obj) {
if (!gameStarted) {
gameStarted = true;
instructionTxt.visible = false;
spawnPipe();
}
bird.flap();
};
// Main game loop
game.update = function () {
if (!gameStarted) return;
// Update bird
bird.update();
// Check bird boundaries
if (bird.y <= 0 || bird.y >= ground.y - 30) {
// Hit ceiling or ground
LK.getSound('hit').play();
LK.showGameOver();
return;
}
// Spawn pipes
pipeSpawnTimer++;
if (pipeSpawnTimer >= pipeSpawnDelay) {
spawnPipe();
pipeSpawnTimer = 0;
}
// Update pipes
for (var i = pipes.length - 1; i >= 0; i--) {
var pipe = pipes[i];
pipe.update();
// Check collision
if (pipe.checkCollision(bird)) {
LK.getSound('hit').play();
LK.showGameOver();
return;
}
// Check if bird passed pipe
if (!pipe.passed && bird.x > pipe.x) {
pipe.passed = true;
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
LK.getSound('score').play();
}
// Remove pipes that are off screen
if (pipe.x < -120) {
pipe.destroy();
pipes.splice(i, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -51,9 +51,9 @@
});
var Pipe = Container.expand(function () {
var self = Container.call(this);
self.speed = -4;
- self.gapSize = 300;
+ self.gapSize = 400;
self.passed = false;
var topPipe = self.attachAsset('pipeTop', {
anchorX: 0.5,
anchorY: 1