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 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.001; var jetpacks = []; var jetpackSpawnTime = 300; var lastJetpackSpawn = 0; 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) { LK.setScore(game.score); LK.getSound('gameOverJingle').play(); 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.005; 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; 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; } scoreText.setText(game.score); scoreText2.setText(game.score); game.obstacleSpeed += game.obstacleSpeedIncrease; obstacleSpawnRandomness -= obstacleSpawnRandomnessDecrease; if (obstacleSpawnRandomness < 30) { obstacleSpawnRandomness = 30; } if (game.score > 0 && game.score % 15 === 0) { game.obstacleSpeedIncrease += 0.0005; obstacleSpawnRandomnessDecrease += 0.001; } 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(); game.score++; 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) { LK.setScore(game.score); LK.getSound('gameOverJingle').play(); LK.showGameOver(); } };
===================================================================
--- original.js
+++ change.js
@@ -141,9 +141,9 @@
tutorialText.visible = false;
LK.gui.bottom.addChild(tutorialText);
game.score = 0;
game.obstacleSpeed = 3;
-game.obstacleSpeedIncrease = 0.003;
+game.obstacleSpeedIncrease = 0.001;
var jetpacks = [];
var jetpackSpawnTime = 300;
var lastJetpackSpawn = 0;
game.checkObstacleCollision = function (obstacles) {
@@ -189,9 +189,9 @@
rightWall.y = 1366;
var leftObstacles = [],
rightObstacles = [];
var obstacleSpawnRandomness = 180;
-var obstacleSpawnRandomnessDecrease = 0.015;
+var obstacleSpawnRandomnessDecrease = 0.005;
var obstacleSpawnY = -500;
var leftObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
var rightObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
bird.x = 1024;
@@ -227,11 +227,11 @@
obstacleSpawnRandomness -= obstacleSpawnRandomnessDecrease;
if (obstacleSpawnRandomness < 30) {
obstacleSpawnRandomness = 30;
}
- if (game.score > 0 && game.score % 10 === 0) {
- game.obstacleSpeedIncrease += 0.001;
- obstacleSpawnRandomnessDecrease += 0.002;
+ if (game.score > 0 && game.score % 15 === 0) {
+ game.obstacleSpeedIncrease += 0.0005;
+ obstacleSpawnRandomnessDecrease += 0.001;
}
if (LK.ticks - lastJetpackSpawn >= jetpackSpawnTime && Math.random() < 0.01) {
var newJetpack = game.addChild(new Jetpack());
newJetpack.x = Math.random() * 1600 + 224;