User prompt
Oyunu çox az daha sürətli çətinləşsin
User prompt
Oyunu özün İstədiyin kimi dahada gündəlik və oyun çoooox daha yavaş çətinləşsin.
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'destroy')' in or related to this line: 'powerUps[i].destroy();' Line Number: 356
User prompt
Oyunu özün İstədiyin kimi güncəllə.
User prompt
Divarda çivi çıxma özəlliyini qaldır. Oyun çox daha yavaş çətinləşsin.
User prompt
Uduzanda 2 ci musiqi çalsın.
User prompt
Oyuna başlayanda musiqi başlasın və hər dəfə bitəndə yenidən başlasın.
User prompt
Oyun daha yavaş zorlaşsın. Her 20 pointer bir zorlaşsın. Zorlaşdıkca duvarda daha fazla çivi çıksın.
User prompt
Oyun gittikçe az-az zorlaşsın.
User prompt
Bird jetpack e deydiğinde baktığı yön değişmesin.
User prompt
Karakter jetpacke deydikde karakter yön değişmesin. Karakter jetpacke deydikte yükselme animasyonu gelsin yani yüksəlsin. Oyun gittikçe zorlaşsın. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'destroy')' in or related to this line: 'jetpacks[i].destroy();' Line Number: 297
User prompt
Oyuna rastgele gelen jetpack elave et. Biz jatpack deyince yüksel animasyanu gelsin ve puanımız 10 artsın. Oyunu biraz dahada kolaylaştır. Oyun gittikçe zorlaşsın. Oyuna başlama menüsü elave et. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Remix started
Copy Flap & Float
/**** * 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.xSpeed = 8; self.ySpeed = -20; self.gravity = 0.7; self.lift = -12; self.flap = function () { self.ySpeed = self.lift * 1.5; LK.getSound('flap').play(); }; self._update_migrated = function () { if (game.isMouseDown) { self.ySpeed += self.gravity / 3; } else { self.ySpeed += self.gravity; } self.y += self.ySpeed; self.x += self.xSpeed; if (self.y <= 0 || self.y >= 2732) { self.speed = -self.speed; } var targetRotation = Math.atan2(self.ySpeed, self.xSpeed * self.scale.x) / 2; birdGraphics.rotation += (targetRotation - birdGraphics.rotation) / 10; }; self.flip = function () { self.scale.x *= -1; }; }); var Jetpack = Container.expand(function () { var self = Container.call(this); var jetpackGraphics = self.attachAsset('jetpack', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 3; self.collected = false; self._move_migrated = function () { self.y += self.speed; }; }); var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleShadow = self.attachAsset('obstacleShadow', { anchorX: 0.5, anchorY: 0.5 }); obstacleShadow.rotation = Math.PI / 4; var obstacleShadow2 = self.attachAsset('obstacleShadow2', { anchorX: 0.5, anchorY: 0.5 }); obstacleShadow2.rotation = Math.PI / 4; obstacleShadow2.y = -7; var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); obstacleGraphics.rotation = Math.PI / 4; self.speed = 5; self._move_migrated = function (speed) { self.y += speed; }; }); var Particle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('particle', { anchorX: 0.5, anchorY: 0.5 }); self.xSpeed = (Math.random() - 0.5) * 10; self.ySpeed = (Math.random() - 0.5) * 10; self.life = 30; self.maxLife = 30; self.update = function () { self.x += self.xSpeed; self.y += self.ySpeed; self.life--; var alpha = self.life / self.maxLife; particleGraphics.alpha = alpha; if (self.life <= 0) { self.destroy(); } }; return self; }); var PowerUp = Container.expand(function () { var self = Container.call(this); var powerUpGraphics = self.attachAsset('particle', { anchorX: 0.5, anchorY: 0.5 }); powerUpGraphics.tint = 0xffd700; powerUpGraphics.scale.set(3, 3); self.speed = 3; self.collected = false; self.bobOffset = Math.random() * Math.PI * 2; self.update = function () { self.y += self.speed; self.x += Math.sin(LK.ticks * 0.1 + self.bobOffset) * 2; powerUpGraphics.rotation += 0.1; }; return self; }); var Wall = Container.expand(function () { var self = Container.call(this); var wallGraphics = self.attachAsset('wall', { anchorX: 0.5, anchorY: 0.5 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ game.gameStarted = false; var startMenuTitle = new Text2('FLAPPY BIRD', { size: 200, fill: '#3a84f7', font: 'Impact', dropShadow: true, dropShadowColor: '#222a9a', dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0, align: 'center' }); startMenuTitle.anchor.set(.5, .5); LK.gui.center.addChild(startMenuTitle); var startMenuText = new Text2('TAP TO START', { size: 120, fill: '#ffffff', font: 'Impact', align: 'center' }); startMenuText.anchor.set(.5, .5); startMenuText.y = 150; LK.gui.center.addChild(startMenuText); var tutorialTextWhite = new Text2('Tap to Flap\nHold to Float', { size: 150, fill: '#ffffff', font: 'Impact', align: 'center' }); tutorialTextWhite.anchor.set(.5, 1); tutorialTextWhite.x = -4; tutorialTextWhite.y = -62; tutorialTextWhite.visible = false; LK.gui.bottom.addChild(tutorialTextWhite); var tutorialText = new Text2('Tap to Flap\nHold to Float', { size: 150, fill: '#3a84f7', font: 'Impact', dropShadow: true, dropShadowColor: '#222a9a', dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0, align: 'center' }); tutorialText.anchor.set(.5, 1); tutorialText.y = -50; tutorialText.visible = false; LK.gui.bottom.addChild(tutorialText); game.score = 0; game.obstacleSpeed = 3; game.obstacleSpeedIncrease = 0.0001; var jetpacks = []; var jetpackSpawnTime = 300; var lastJetpackSpawn = 0; var particles = []; var powerUps = []; var powerUpSpawnTime = 500; var lastPowerUpSpawn = 0; var comboMultiplier = 1; var lastScoreTime = 0; game.createParticles = function (x, y, count, color) { for (var i = 0; i < count; i++) { var particle = game.addChild(new Particle()); particle.x = x; particle.y = y; if (color) { particle.children[0].tint = color; } particles.push(particle); } }; game.checkObstacleCollision = function (obstacles) { for (var i = 0; i < obstacles.length; i++) { obstacles[i]._move_migrated(); var dist = Math.sqrt(Math.pow(bird.x - obstacles[i].x, 2) + Math.pow(bird.y - obstacles[i].y, 2)); if (dist < 280) { game.createParticles(bird.x, bird.y, 15, 0xff0000); LK.setScore(game.score); LK.getSound('gameOverJingle').play(); LK.playMusic('defeatMusic', { loop: false }); LK.showGameOver(); } } }; game.setBackgroundColor(0xadd8e6); var scoreText = new Text2('0', { size: 150, fill: '#3a84f7', font: 'Impact', dropShadow: true, dropShadowColor: '#222a9a', dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0 }); scoreText.anchor.set(.5, 0); LK.gui.top.addChild(scoreText); var scoreText2 = new Text2('0', { size: 150, fill: '#ffffff', font: 'Impact' }); scoreText2.anchor.set(.5, 0); scoreText2.x = -4; scoreText2.y = -5; LK.gui.top.addChild(scoreText2); LK.gui.top.addChild(scoreText); var bird = game.addChild(new Bird()); var leftWall = game.addChild(new Wall()); leftWall.x = 0; leftWall.y = 1366; var rightWall = game.addChild(new Wall()); rightWall.x = 2048; rightWall.y = 1366; var leftObstacles = [], rightObstacles = []; var obstacleSpawnRandomness = 180; var obstacleSpawnRandomnessDecrease = 0.0005; var obstacleSpawnY = -500; var leftObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness; var rightObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness; bird.x = 1024; bird.y = 1366; game.isMouseDown = false; game.down = function (x, y, obj) { if (!game.gameStarted) { game.gameStarted = true; startMenuTitle.visible = false; startMenuText.visible = false; tutorialText.visible = true; tutorialTextWhite.visible = true; LK.playMusic('backgroundMusic', { loop: true }); return; } bird.flap(); game.isMouseDown = true; }; game.up = function (x, y, obj) { game.isMouseDown = false; }; game.update = function () { if (!game.gameStarted) { return; } bird._update_migrated(); if (game.score > 2) { tutorialText.y += 5; tutorialTextWhite.y += 5; } // Update combo multiplier based on scoring frequency if (LK.ticks - lastScoreTime > 180) { comboMultiplier = 1; } var displayScore = game.score; if (comboMultiplier > 1) { displayScore += ' x' + comboMultiplier; } scoreText.setText(displayScore); scoreText2.setText(displayScore); // Dynamic difficulty scaling var difficultyLevel = Math.floor(game.score / 10); game.obstacleSpeed = 3 + difficultyLevel * 0.5; obstacleSpawnRandomness = Math.max(50, 180 - difficultyLevel * 5); // Update particles for (var i = particles.length - 1; i >= 0; i--) { particles[i].update(); if (particles[i].life <= 0) { particles.splice(i, 1); } } // Spawn power-ups if (LK.ticks - lastPowerUpSpawn >= powerUpSpawnTime && Math.random() < 0.008) { var newPowerUp = game.addChild(new PowerUp()); newPowerUp.x = Math.random() * 1600 + 224; newPowerUp.y = -50; powerUps.push(newPowerUp); lastPowerUpSpawn = LK.ticks; powerUpSpawnTime = 400 + Math.random() * 600; } // Update power-ups for (var i = powerUps.length - 1; i >= 0; i--) { powerUps[i].update(); if (bird.intersects(powerUps[i]) && !powerUps[i].collected) { powerUps[i].collected = true; game.createParticles(powerUps[i].x, powerUps[i].y, 8, 0xffd700); comboMultiplier++; game.score += 5 * comboMultiplier; lastScoreTime = LK.ticks; LK.setScore(game.score); LK.getSound('U').play(); tween(powerUps[i], { alpha: 0, scaleX: 6, scaleY: 6 }, { duration: 300, onFinish: function onFinish() { powerUps[i].destroy(); } }); powerUps.splice(i, 1); continue; } if (powerUps[i].y > 3000) { powerUps[i].destroy(); powerUps.splice(i, 1); } } if (LK.ticks - lastJetpackSpawn >= jetpackSpawnTime && Math.random() < 0.01) { var newJetpack = game.addChild(new Jetpack()); newJetpack.x = Math.random() * 1600 + 224; newJetpack.y = -100; jetpacks.push(newJetpack); lastJetpackSpawn = LK.ticks; jetpackSpawnTime = 200 + Math.random() * 400; } if (LK.ticks >= leftObstacleSpawnTime) { var newObstacle = game.addChildAt(new Obstacle(), 0); newObstacle.x = 0; newObstacle.y = obstacleSpawnY; leftObstacles.push(newObstacle); leftObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness; } if (LK.ticks >= rightObstacleSpawnTime) { var newObstacle = game.addChildAt(new Obstacle(), 0); newObstacle.x = 2048; newObstacle.y = -newObstacle.height; rightObstacles.push(newObstacle); rightObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness; } for (var i = jetpacks.length - 1; i >= 0; i--) { jetpacks[i]._move_migrated(); if (bird.intersects(jetpacks[i]) && !jetpacks[i].collected) { jetpacks[i].collected = true; bird.ySpeed = -25; game.score += 10; LK.setScore(game.score); LK.getSound('jetpackSound').play(); var currentDirection = bird.scale.x > 0 ? 1 : -1; tween(bird, { y: bird.y - 200 }, { duration: 500, easing: tween.easeOut }); tween(bird, { scaleX: 1.3 * currentDirection, scaleY: 1.3 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(bird, { scaleX: 1 * currentDirection, scaleY: 1 }, { duration: 200, easing: tween.easeIn }); } }); var jetpackToDestroy = jetpacks[i]; tween(jetpacks[i], { alpha: 0, scaleX: 2, scaleY: 2 }, { duration: 300, onFinish: function onFinish() { jetpackToDestroy.destroy(); } }); jetpacks.splice(i, 1); continue; } if (jetpacks[i].y > 3232) { jetpacks[i].destroy(); jetpacks.splice(i, 1); } } if (bird.intersects(leftWall) && bird.xSpeed < 0 || bird.intersects(rightWall) && bird.xSpeed > 0) { bird.xSpeed = -bird.xSpeed; bird.flip(); // Combo scoring system if (LK.ticks - lastScoreTime < 180) { comboMultiplier++; } else { comboMultiplier = 1; } var bounceScore = 1 * comboMultiplier; game.score += bounceScore; lastScoreTime = LK.ticks; // Create bounce particles var wallX = bird.intersects(leftWall) ? leftWall.x + 50 : rightWall.x - 50; game.createParticles(wallX, bird.y, 5, 0x3a84f7); LK.setScore(game.score); LK.getSound('bounce').play(); } for (var i = leftObstacles.length - 1; i >= 0; i--) { leftObstacles[i]._move_migrated(game.obstacleSpeed); if (leftObstacles[i].y > 3232) { leftObstacles[i].destroy(); leftObstacles.splice(i, 1); } } for (var i = rightObstacles.length - 1; i >= 0; i--) { rightObstacles[i]._move_migrated(game.obstacleSpeed); if (rightObstacles[i].y > 3232) { rightObstacles[i].destroy(); rightObstacles.splice(i, 1); } } game.checkObstacleCollision(leftObstacles); game.checkObstacleCollision(rightObstacles); if (bird.y < 0 || bird.y > 2732) { game.createParticles(bird.x, bird.y < 0 ? 0 : 2732, 20, 0xff0000); // Screen shake effect tween(game, { x: 10 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: -10 }, { duration: 50, onFinish: function onFinish() { tween(game, { x: 0 }, { duration: 50 }); } }); } }); LK.setScore(game.score); LK.getSound('gameOverJingle').play(); LK.playMusic('defeatMusic', { loop: false }); LK.showGameOver(); } };
===================================================================
--- original.js
+++ change.js
@@ -72,8 +72,48 @@
self._move_migrated = function (speed) {
self.y += speed;
};
});
+var Particle = Container.expand(function () {
+ var self = Container.call(this);
+ var particleGraphics = self.attachAsset('particle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.xSpeed = (Math.random() - 0.5) * 10;
+ self.ySpeed = (Math.random() - 0.5) * 10;
+ self.life = 30;
+ self.maxLife = 30;
+ self.update = function () {
+ self.x += self.xSpeed;
+ self.y += self.ySpeed;
+ self.life--;
+ var alpha = self.life / self.maxLife;
+ particleGraphics.alpha = alpha;
+ if (self.life <= 0) {
+ self.destroy();
+ }
+ };
+ return self;
+});
+var PowerUp = Container.expand(function () {
+ var self = Container.call(this);
+ var powerUpGraphics = self.attachAsset('particle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ powerUpGraphics.tint = 0xffd700;
+ powerUpGraphics.scale.set(3, 3);
+ self.speed = 3;
+ self.collected = false;
+ self.bobOffset = Math.random() * Math.PI * 2;
+ self.update = function () {
+ self.y += self.speed;
+ self.x += Math.sin(LK.ticks * 0.1 + self.bobOffset) * 2;
+ powerUpGraphics.rotation += 0.1;
+ };
+ return self;
+});
var Wall = Container.expand(function () {
var self = Container.call(this);
var wallGraphics = self.attachAsset('wall', {
anchorX: 0.5,
@@ -145,13 +185,31 @@
game.obstacleSpeedIncrease = 0.0001;
var jetpacks = [];
var jetpackSpawnTime = 300;
var lastJetpackSpawn = 0;
+var particles = [];
+var powerUps = [];
+var powerUpSpawnTime = 500;
+var lastPowerUpSpawn = 0;
+var comboMultiplier = 1;
+var lastScoreTime = 0;
+game.createParticles = function (x, y, count, color) {
+ for (var i = 0; i < count; i++) {
+ var particle = game.addChild(new Particle());
+ particle.x = x;
+ particle.y = y;
+ if (color) {
+ particle.children[0].tint = color;
+ }
+ particles.push(particle);
+ }
+};
game.checkObstacleCollision = function (obstacles) {
for (var i = 0; i < obstacles.length; i++) {
obstacles[i]._move_migrated();
var dist = Math.sqrt(Math.pow(bird.x - obstacles[i].x, 2) + Math.pow(bird.y - obstacles[i].y, 2));
if (dist < 280) {
+ game.createParticles(bird.x, bird.y, 15, 0xff0000);
LK.setScore(game.score);
LK.getSound('gameOverJingle').play();
LK.playMusic('defeatMusic', {
loop: false
@@ -226,19 +284,67 @@
if (game.score > 2) {
tutorialText.y += 5;
tutorialTextWhite.y += 5;
}
- scoreText.setText(game.score);
- scoreText2.setText(game.score);
- game.obstacleSpeed += game.obstacleSpeedIncrease;
- obstacleSpawnRandomness -= obstacleSpawnRandomnessDecrease;
- if (obstacleSpawnRandomness < 30) {
- obstacleSpawnRandomness = 30;
+ // Update combo multiplier based on scoring frequency
+ if (LK.ticks - lastScoreTime > 180) {
+ comboMultiplier = 1;
}
- if (game.score > 0 && game.score % 50 === 0) {
- game.obstacleSpeedIncrease += 0.00005;
- obstacleSpawnRandomnessDecrease += 0.0001;
+ var displayScore = game.score;
+ if (comboMultiplier > 1) {
+ displayScore += ' x' + comboMultiplier;
}
+ scoreText.setText(displayScore);
+ scoreText2.setText(displayScore);
+ // Dynamic difficulty scaling
+ var difficultyLevel = Math.floor(game.score / 10);
+ game.obstacleSpeed = 3 + difficultyLevel * 0.5;
+ obstacleSpawnRandomness = Math.max(50, 180 - difficultyLevel * 5);
+ // Update particles
+ for (var i = particles.length - 1; i >= 0; i--) {
+ particles[i].update();
+ if (particles[i].life <= 0) {
+ particles.splice(i, 1);
+ }
+ }
+ // Spawn power-ups
+ if (LK.ticks - lastPowerUpSpawn >= powerUpSpawnTime && Math.random() < 0.008) {
+ var newPowerUp = game.addChild(new PowerUp());
+ newPowerUp.x = Math.random() * 1600 + 224;
+ newPowerUp.y = -50;
+ powerUps.push(newPowerUp);
+ lastPowerUpSpawn = LK.ticks;
+ powerUpSpawnTime = 400 + Math.random() * 600;
+ }
+ // Update power-ups
+ for (var i = powerUps.length - 1; i >= 0; i--) {
+ powerUps[i].update();
+ if (bird.intersects(powerUps[i]) && !powerUps[i].collected) {
+ powerUps[i].collected = true;
+ game.createParticles(powerUps[i].x, powerUps[i].y, 8, 0xffd700);
+ comboMultiplier++;
+ game.score += 5 * comboMultiplier;
+ lastScoreTime = LK.ticks;
+ LK.setScore(game.score);
+ LK.getSound('U').play();
+ tween(powerUps[i], {
+ alpha: 0,
+ scaleX: 6,
+ scaleY: 6
+ }, {
+ duration: 300,
+ onFinish: function onFinish() {
+ powerUps[i].destroy();
+ }
+ });
+ powerUps.splice(i, 1);
+ continue;
+ }
+ if (powerUps[i].y > 3000) {
+ powerUps[i].destroy();
+ powerUps.splice(i, 1);
+ }
+ }
if (LK.ticks - lastJetpackSpawn >= jetpackSpawnTime && Math.random() < 0.01) {
var newJetpack = game.addChild(new Jetpack());
newJetpack.x = Math.random() * 1600 + 224;
newJetpack.y = -100;
@@ -312,9 +418,20 @@
}
if (bird.intersects(leftWall) && bird.xSpeed < 0 || bird.intersects(rightWall) && bird.xSpeed > 0) {
bird.xSpeed = -bird.xSpeed;
bird.flip();
- game.score++;
+ // Combo scoring system
+ if (LK.ticks - lastScoreTime < 180) {
+ comboMultiplier++;
+ } else {
+ comboMultiplier = 1;
+ }
+ var bounceScore = 1 * comboMultiplier;
+ game.score += bounceScore;
+ lastScoreTime = LK.ticks;
+ // Create bounce particles
+ var wallX = bird.intersects(leftWall) ? leftWall.x + 50 : rightWall.x - 50;
+ game.createParticles(wallX, bird.y, 5, 0x3a84f7);
LK.setScore(game.score);
LK.getSound('bounce').play();
}
for (var i = leftObstacles.length - 1; i >= 0; i--) {
@@ -333,8 +450,29 @@
}
game.checkObstacleCollision(leftObstacles);
game.checkObstacleCollision(rightObstacles);
if (bird.y < 0 || bird.y > 2732) {
+ game.createParticles(bird.x, bird.y < 0 ? 0 : 2732, 20, 0xff0000);
+ // Screen shake effect
+ tween(game, {
+ x: 10
+ }, {
+ duration: 50,
+ onFinish: function onFinish() {
+ tween(game, {
+ x: -10
+ }, {
+ duration: 50,
+ onFinish: function onFinish() {
+ tween(game, {
+ x: 0
+ }, {
+ duration: 50
+ });
+ }
+ });
+ }
+ });
LK.setScore(game.score);
LK.getSound('gameOverJingle').play();
LK.playMusic('defeatMusic', {
loop: false