User prompt
Yukarıya doğru gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Ne kadar uzun süre basarsak okadar uzağa gitsin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'fill')' in or related to this line: 'powerBarFill.style.fill = '#ffff00'; // Yellow' Line Number: 393
User prompt
Bı bar olsun altta ne kadar uzun süre basılı tutarsak okadar daha çok zıplatsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Mesala buton renklerini kolay kirmiziysa orta sarı yap
User prompt
Buton renkleri sarı ve kırmızı yap
User prompt
En yüksek rekorumuz başlama ekranında gözüksün
User prompt
Oyun kolay modda üste gidince ölmek yerine şekerlik
User prompt
Butonlar pembe olsun
Code edit (1 edits merged)
Please save this source code
User prompt
Butanların rengi yesîl mavi olsun
User prompt
Bir tane daha da mod eklensin imkansız diye mod zor dan da zor olsun
User prompt
rekorumuz baslama ekranında gözusun
User prompt
rekorumuz gözuksun sag üstte best diye
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'var bestScore = storage.get('bestScore') || 0;' Line Number: 307 ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'storage.getItem is not a function' in or related to this line: 'var bestScore = storage.getItem('bestScore') || 0;' Line Number: 307
User prompt
Please fix the bug: 'storage.get is not a function' in or related to this line: 'var bestScore = storage.get('bestScore') || 0;' Line Number: 307
User prompt
rekorumuz gözüksun sag üstte en iyi rekor diye
User prompt
skor tablosuda ekle
User prompt
dil secimide olsun
Remix started
zorluk secelim kolay orta zor
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1"); 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 = 10.9375; self.ySpeed = -20; self.gravity = 1; self.lift = -15; self.flap = function (power) { power = power || 1; self.ySpeed = self.lift * (1.5 + power * 0.5); // Add horizontal movement based on power - longer holds go further var horizontalBoost = power * 15; // Base horizontal speed multiplier self.xSpeed = Math.abs(self.xSpeed) * (1 + horizontalBoost * 0.3) * (self.xSpeed > 0 ? 1 : -1); 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 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 ****/ // Language selection UI var languageSelected = false; var selectedLanguage = "tr"; var languages = [{ label: "Türkçe", code: "tr" }, { label: "English", code: "en" }]; var languageButtons = []; var languageText = new Text2('Dil Seçin / Select Language', { size: 180, fill: '#3a84f7', font: 'Impact', align: 'center' }); languageText.anchor.set(0.5, 1); languageText.y = -600; LK.gui.center.addChild(languageText); for (var i = 0; i < languages.length; i++) { var lbtn = new Text2(languages[i].label, { size: 150, fill: '#ffff00', // Yellow font: 'Impact', align: 'center', dropShadow: true, dropShadowColor: '#ff0000', // Red shadow dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0 }); lbtn.anchor.set(0.5, 0.5); lbtn.y = -400 + i * 220; lbtn.x = 0; (function (idx) { lbtn.interactive = true; lbtn.down = function (x, y, obj) { if (languageSelected) { return; } languageSelected = true; selectedLanguage = languages[idx].code; // Remove language buttons and text for (var j = 0; j < languageButtons.length; j++) { LK.gui.center.removeChild(languageButtons[j]); } LK.gui.center.removeChild(languageText); // Update best score label language after language selection bestScoreLabel = selectedLanguage === "tr" ? "En İyi" : "Best"; bestScoreText.setText(bestScoreLabel + ": " + bestScore); // Show difficulty selection showDifficultySelection(); }; })(i); LK.gui.center.addChild(lbtn); languageButtons.push(lbtn); } // Difficulty selection UI var difficultySelected = false; var difficulties = [{ label: { tr: "Kolay", en: "Easy" }, speed: 4, speedInc: 0.003, randomness: 160 }, { label: { tr: "ortadeil", en: "Medium" }, speed: 5, speedInc: 0.005, randomness: 120 }, { label: { tr: "Zor", en: "Hard" }, speed: 6, speedInc: 0.008, randomness: 80 }, { label: { tr: "İmkansız", en: "Impossible" }, speed: 8, speedInc: 0.018, randomness: 40 }]; var difficultyButtons = []; var difficultyText; function showDifficultySelection() { difficultySelected = false; difficultyButtons = []; var diffTextStr = selectedLanguage === "tr" ? "Zorluk Seçin" : "Select Difficulty"; difficultyText = new Text2(diffTextStr, { size: 180, fill: '#3a84f7', font: 'Impact', align: 'center' }); difficultyText.anchor.set(0.5, 1); difficultyText.y = -400; LK.gui.center.addChild(difficultyText); for (var i = 0; i < difficulties.length; i++) { var btn = new Text2(difficulties[i].label[selectedLanguage], { size: 150, fill: i === 0 ? '#ff0000' : i === 1 ? '#ffff00' : i === 3 ? '#ff0000' : '#ffff00', // Easy: red, Medium: yellow, Impossible: red, Hard: yellow font: 'Impact', align: 'center', dropShadow: true, dropShadowColor: i === 3 ? '#222a9a' : '#ff0000', // Impossible: dark blue, others: red dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0 }); btn.anchor.set(0.5, 0.5); btn.y = -200 + i * 220; btn.x = 0; // Attach event (function (idx) { btn.interactive = true; btn.down = function (x, y, obj) { if (difficultySelected) { return; } difficultySelected = true; // Set game difficulty game.obstacleSpeed = difficulties[idx].speed; game.obstacleSpeedIncrease = difficulties[idx].speedInc; obstacleSpawnRandomness = difficulties[idx].randomness; // Remove buttons and text for (var j = 0; j < difficultyButtons.length; j++) { LK.gui.center.removeChild(difficultyButtons[j]); } LK.gui.center.removeChild(difficultyText); // Show tutorial tutorialText.visible = true; tutorialTextWhite.visible = true; // Update tutorial text language if (selectedLanguage === "tr") { tutorialText.setText('Zıpla\nHavada Kalmak İçin Basılı Tut'); tutorialTextWhite.setText('Zıpla\nHavada Kalmak İçin Basılı Tut'); } else { tutorialText.setText('Tap to Flap\nHold to Float'); tutorialTextWhite.setText('Tap to Flap\nHold to Float'); } }; })(i); LK.gui.center.addChild(btn); difficultyButtons.push(btn); } } // Hide tutorial until difficulty is picked, will update for language 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 = 5; game.obstacleSpeedIncrease = 0.005; 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(); LK.showLeaderboard && LK.showLeaderboard(); // Show leaderboard if available } } }; 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); // Best score display (top right) var bestScore = typeof storage.bestScore === "number" ? storage.bestScore : 0; var bestScoreLabel = selectedLanguage === "tr" ? "En İyi" : "Best"; var bestScoreText = new Text2(bestScoreLabel + ": " + bestScore, { size: 90, fill: '#3a84f7', font: 'Impact', dropShadow: true, dropShadowColor: '#222a9a', dropShadowBlur: 5, dropShadowDistance: 7, dropShadowAngle: 0 }); bestScoreText.anchor.set(1, 0); bestScoreText.x = 2048 - 40; bestScoreText.y = 0; LK.gui.topRight.addChild(bestScoreText); // Always show best score on language selection screen bestScoreText.visible = !languageSelected; 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 = 120; var obstacleSpawnRandomnessDecrease = 0.025 * (2 / 3); 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; // Power bar system var powerBarBg = new Text2('████████████████████████████████████████', { size: 80, fill: '#333333', font: 'Impact', align: 'center' }); powerBarBg.anchor.set(0.5, 1); powerBarBg.y = -20; LK.gui.bottom.addChild(powerBarBg); var powerBarFill = new Text2('', { size: 80, fill: '#ffff00', font: 'Impact', align: 'center' }); powerBarFill.anchor.set(0.5, 1); powerBarFill.y = -20; LK.gui.bottom.addChild(powerBarFill); var powerLevel = 0; var maxPowerLevel = 100; var powerChargeRate = 2; var holdStartTime = 0; function updatePowerBar() { var fillPercentage = powerLevel / maxPowerLevel; var maxBars = 40; var filledBars = Math.floor(maxBars * fillPercentage); var barText = ''; for (var i = 0; i < filledBars; i++) { barText += '█'; } powerBarFill.setText(barText); // Change color based on power level if (fillPercentage < 0.3) { powerBarFill.fill = '#ffff00'; // Yellow } else if (fillPercentage < 0.7) { powerBarFill.fill = '#ff8800'; // Orange } else { powerBarFill.fill = '#ff0000'; // Red } } game.down = function (x, y, obj) { if (!languageSelected || !difficultySelected) { return; } game.isMouseDown = true; holdStartTime = LK.ticks; powerLevel = 0; }; game.up = function (x, y, obj) { if (!languageSelected || !difficultySelected) { return; } game.isMouseDown = false; // Use accumulated power for flap var powerMultiplier = powerLevel / maxPowerLevel; bird.flap(powerMultiplier); // Add visual feedback for powerful flaps with scale animation if (powerMultiplier > 0.5) { tween(bird, { scaleX: bird.scale.x * 1.3, scaleY: bird.scale.y * 1.3 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { tween(bird, { scaleX: bird.scale.x / 1.3, scaleY: bird.scale.y / 1.3 }, { duration: 200, easing: tween.easeIn }); } }); } // Reset power level and animate bar shrinking tween(powerBarFill, { alpha: 0.3 }, { duration: 300, onFinish: function onFinish() { powerBarFill.alpha = 1; } }); powerLevel = 0; updatePowerBar(); }; game.update = function () { if (!languageSelected) { // Block all game logic until language is picked return; } if (!difficultySelected) { // Block all game logic until difficulty is picked return; } bird._update_migrated(); // Update power bar when holding down if (game.isMouseDown) { var holdDuration = LK.ticks - holdStartTime; powerLevel = Math.min(maxPowerLevel, holdDuration * powerChargeRate); updatePowerBar(); } if (game.score > 2) { tutorialText.y += 5; tutorialTextWhite.y += 5; } scoreText.setText(game.score); scoreText2.setText(game.score); // Update best score if needed if (game.score > bestScore) { bestScore = game.score; storage.bestScore = bestScore; var bestScoreLabel = selectedLanguage === "tr" ? "En İyi" : "Best"; bestScoreText.setText(bestScoreLabel + ": " + bestScore); } game.obstacleSpeed += game.obstacleSpeedIncrease; obstacleSpawnRandomness -= obstacleSpawnRandomnessDecrease; if (obstacleSpawnRandomness < 20) { obstacleSpawnRandomness = 20; } 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; } 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) { // Kolay modda üstten çıkınca şekerlik efekti, diğer modlarda game over if (game.obstacleSpeed === difficulties[0].speed && game.obstacleSpeedIncrease === difficulties[0].speedInc && obstacleSpawnRandomness + obstacleSpawnRandomnessDecrease === difficulties[0].randomness) { // Şekerlik efekti: Bird'i ekranda aşağıya yumuşakça geri getir, renk değiştir, puan ver if (!bird.sugarEffectActive) { bird.sugarEffectActive = true; // Bird'i pembe yap ve yavaşça aşağıya getir var originalY = bird.y; var originalColor = bird.children[0].tint; var tweenDuration = 40; var step = 0; var startY = bird.y; var endY = 200; var startColor = 0xff69b4; var endColor = 0xffffff; bird.children[0].tint = startColor; var sugarTween = LK.setInterval(function () { step++; bird.y = startY + (endY - startY) * (step / tweenDuration); if (step >= tweenDuration) { LK.clearInterval(sugarTween); bird.children[0].tint = endColor; bird.sugarEffectActive = false; } }, 10); // Puan ver game.score += 2; LK.setScore(game.score); LK.getSound('flap').play(); } // Bird'in y'sini 0'da sabitle, tekrar yukarı çıkmasını engelle bird.y = 0; bird.ySpeed = 0; } else if (bird.y > 2732 || bird.y < 0) { LK.setScore(game.score); LK.getSound('gameOverJingle').play(); LK.showGameOver(); LK.showLeaderboard && LK.showLeaderboard(); // Show leaderboard if available } } else if (bird.y > 2732) { LK.setScore(game.score); LK.getSound('gameOverJingle').play(); LK.showGameOver(); LK.showLeaderboard && LK.showLeaderboard(); // Show leaderboard if available } };
===================================================================
--- original.js
+++ change.js
@@ -19,8 +19,11 @@
self.lift = -15;
self.flap = function (power) {
power = power || 1;
self.ySpeed = self.lift * (1.5 + power * 0.5);
+ // Add horizontal movement based on power - longer holds go further
+ var horizontalBoost = power * 15; // Base horizontal speed multiplier
+ self.xSpeed = Math.abs(self.xSpeed) * (1 + horizontalBoost * 0.3) * (self.xSpeed > 0 ? 1 : -1);
LK.getSound('flap').play();
};
self._update_migrated = function () {
if (game.isMouseDown) {
@@ -399,8 +402,27 @@
game.isMouseDown = false;
// Use accumulated power for flap
var powerMultiplier = powerLevel / maxPowerLevel;
bird.flap(powerMultiplier);
+ // Add visual feedback for powerful flaps with scale animation
+ if (powerMultiplier > 0.5) {
+ tween(bird, {
+ scaleX: bird.scale.x * 1.3,
+ scaleY: bird.scale.y * 1.3
+ }, {
+ duration: 200,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ tween(bird, {
+ scaleX: bird.scale.x / 1.3,
+ scaleY: bird.scale.y / 1.3
+ }, {
+ duration: 200,
+ easing: tween.easeIn
+ });
+ }
+ });
+ }
// Reset power level and animate bar shrinking
tween(powerBarFill, {
alpha: 0.3
}, {