User prompt
Ana menü butonlarını hizala
User prompt
Premium mağaza da ekle ana menüye ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Premium geçiş butonunu sayfanın en üstüne getir
User prompt
Premium geçiş butonu sayfaya sığmıyor onu düzgün bir yere koy
User prompt
Premium geçiş butonunu sayfanın en üst köşe sağına hizala
User prompt
Premium geçiş eklenebilir ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Ana menünün en altına copyright kısmını yazısını yaz
User prompt
Ana menü giriş ekranına girmeden önce bir ekran getir Misafir olarak giriş yap yada kayıt ol diye. Misafir olarak giriş yapa tıklayınca ana menüye girilsin ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Oyun başlangıcında geri sayım güzel fikir yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyuna yeni şeyler ekle
User prompt
Bölüm 2 ye geçince fazla basket potası oluyor neden
User prompt
Bölüm 1 hedef yazısını daha özenli yap
User prompt
Pause devam butonu ekle
User prompt
Ana menü ekranında müzik çalsın müzik adı mainmenubackground ekle
User prompt
Ayarlar bölümüne grafik ayarlama da ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Ayarlar kısmının animasyonu düzelt çok sağa sola dönmesin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
İstatistiklerim butonunu da ayarlar butonunuda yapimcilar butonunuda oyuna son eklenenler butonunuda çıkış butonunuda özenli farklı yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Nasıl oynanır butonunu da farkli bir özen yap ? Soru işareti vs ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Oyuna başlar yazısını daha özenli yap ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Topları yakala yazısında yanan rengi sarı yap ve sürekli yanıp sönsün hızlı ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
RENKLİ TOPLARI YAKALAMA OYUNU yazısını TOPLARI YAKALA olarak değiştir.ve bu yazıya daha fazla animasyon ekle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Sadece ana menü arka planı değiştirmek istiyorum.
User prompt
Nasıl oynanır menüsünü düzenle
User prompt
Oyuna son eklenenler menüsünün içinde anasayfa dön butonu gözükmüyor onun yerini sol orta köşeye al
User prompt
Oyuna son eklenenler menüsüne back butonu ekle ana sayfa
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1", { musicEnabled: true, difficultyLevel: "Normal", gameSpeedSetting: "Normal", colorMode: "Normal", shapeSize: "Normal", redBallsCollected: 0, blueBallsCollected: 0, yellowBallsCollected: 0, particleEffectsEnabled: true, screenEffectsEnabled: true, animationQuality: "High" }); /**** * Classes ****/ var BackgroundParticle = Container.expand(function () { var self = Container.call(this); var colors = [0xfeca57, 0xff9500, 0xff69b4, 0x4da6ff, 0xffffff]; // Yellow, Orange, Pink, Blue, White var randomColor = colors[Math.floor(Math.random() * colors.length)]; var particleGraphics = self.attachAsset('particle', { anchorX: 0.5, anchorY: 0.5 }); particleGraphics.tint = randomColor; particleGraphics.alpha = 0.3 + Math.random() * 0.4; // Random transparency self.speedX = (Math.random() - 0.5) * 0.5; self.speedY = -0.3 - Math.random() * 0.7; self.life = 0; self.maxLife = 300 + Math.random() * 200; var initialScale = 0.3 + Math.random() * 0.7; particleGraphics.scaleX = initialScale; particleGraphics.scaleY = initialScale; self.update = function () { self.x += self.speedX; self.y += self.speedY; self.life++; // Fade out as particle ages var lifeRatio = self.life / self.maxLife; particleGraphics.alpha = (1 - lifeRatio) * (0.3 + Math.random() * 0.4); // Gentle floating motion self.x += Math.sin(self.life * 0.01) * 0.1; // Remove particle when it's old or off screen if (self.life >= self.maxLife || self.y < -50 || self.x < -50 || self.x > 2100) { self.shouldRemove = true; } }; return self; }); var Basket = Container.expand(function (color) { var self = Container.call(this); self.color = color; var basketGraphics = self.attachAsset(color + 'Basket', { anchorX: 0.5, anchorY: 0.5 }); // Apply shape size setting to baskets var sizeMultiplier = shapeSize === 'Small' ? 0.7 : shapeSize === 'Large' ? 1.3 : 1.0; basketGraphics.scaleX = sizeMultiplier; basketGraphics.scaleY = sizeMultiplier; return self; }); var FallingShape = Container.expand(function (color) { var self = Container.call(this); self.color = color; self.speed = 3; self.lastY = 0; var shapeGraphics = self.attachAsset(color + 'Shape', { anchorX: 0.5, anchorY: 0.5 }); // Apply shape size setting var sizeMultiplier = shapeSize === 'Small' ? 0.7 : shapeSize === 'Large' ? 1.3 : 1.0; shapeGraphics.scaleX = sizeMultiplier; shapeGraphics.scaleY = sizeMultiplier; self.update = function () { self.lastY = self.y; self.y += self.speed; }; return self; }); var MenuButton = Container.expand(function (text, color) { var self = Container.call(this); // Create button background self.bg = LK.getAsset('shape', { width: 600, height: 120, color: color || 0x3498db, shape: 'ellipse', anchorX: 0.5, anchorY: 0.5 }); self.addChild(self.bg); // Create button text self.text = new Text2(text, { size: 60, fill: 0xFFFFFF }); self.text.anchor.set(0.5, 0.5); self.addChild(self.text); self.isPressed = false; self.down = function (x, y, obj) { self.isPressed = true; tween(self, { scaleX: 0.95, scaleY: 0.95 }, { duration: 100 }); }; self.up = function (x, y, obj) { if (self.isPressed) { self.isPressed = false; tween(self, { scaleX: 1, scaleY: 1 }, { duration: 100 }); if (self.onClick) { self.onClick(); } } }; return self; }); var PowerUp = Container.expand(function (type) { var self = Container.call(this); self.type = type; // 'slowMotion' or 'doublePoints' self.speed = 2; self.lastY = 0; var powerUpGraphics = self.attachAsset(type + 'PowerUp', { anchorX: 0.5, anchorY: 0.5 }); // Add glowing effect powerUpGraphics.alpha = 0.8; var glowPhase = 0; self.update = function () { self.lastY = self.y; self.y += self.speed; // Glow animation glowPhase += 0.1; powerUpGraphics.alpha = 0.6 + Math.sin(glowPhase) * 0.3; // Gentle rotation powerUpGraphics.rotation += 0.05; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x2c3e50 }); /**** * Game Code ****/ // Function to format game time from seconds to readable format function formatGameTime(seconds) { var hours = Math.floor(seconds / 3600); var minutes = Math.floor(seconds % 3600 / 60); var remainingSeconds = seconds % 60; if (hours > 0) { return hours + ' saat ' + minutes + ' dakika ' + remainingSeconds + ' saniye'; } else if (minutes > 0) { return minutes + ' dakika ' + remainingSeconds + ' saniye'; } else { return remainingSeconds + ' saniye'; } } var baskets = []; var fallingShapes = []; var powerUps = []; var slowMotionActive = false; var doublePointsActive = false; var slowMotionTimer = 0; var doublePointsTimer = 0; var powerUpSpawnTimer = 0; // Update colors based on color mode var colors = colorMode === 'ColorBlind' ? ['red', 'blue', 'yellow'] : ['red', 'blue', 'yellow']; // Note: In real implementation, colorblind mode would use different color combinations var gameSpeed = 1; var consecutiveMatches = 0; var draggedBasket = null; var gameState = 'menu'; // 'menu', 'playing', 'howtoplay', 'settings' var menuButtons = []; var currentMenu = null; var musicEnabled = storage.musicEnabled !== undefined ? storage.musicEnabled : true; // Track music state var highScore = storage.highScore || 0; // Load saved high score // Game time tracking var totalGameTime = storage.totalGameTime || 0; // Total time played in seconds var currentSessionStartTime = 0; // When current game session started var gameTimeTimer = null; // Timer for tracking game time var sessionStartTime = 0; // Track when current session actually started // Ball collection requirements and tracking var ballRequirements = { red: 5, blue: 5, yellow: 5 }; var ballsCollected = { red: storage.redBallsCollected || 0, blue: storage.blueBallsCollected || 0, yellow: storage.yellowBallsCollected || 0 }; // Level system var currentLevel = 1; var levelCompleted = false; storage.currentLevel = 1; // Game settings from storage var difficultyLevel = storage.difficultyLevel || 'Normal'; // Easy, Normal, Hard var gameSpeedSetting = storage.gameSpeedSetting || 'Normal'; // Slow, Normal, Fast var colorMode = storage.colorMode || 'Normal'; // Normal, ColorBlind var shapeSize = storage.shapeSize || 'Normal'; // Small, Normal, Large // Create animated background var backgroundContainer = new Container(); game.addChild(backgroundContainer); // Create menu background var menuBg = LK.getAsset('menuBackground', { anchorX: 0, anchorY: 0 }); menuBg.x = 0; menuBg.y = 0; menuBg.alpha = 0.9; backgroundContainer.addChild(menuBg); // Create gradient layers var gradientLayer1 = LK.getAsset('gradientLayer1', { anchorX: 0, anchorY: 0 }); gradientLayer1.x = 0; gradientLayer1.y = 0; gradientLayer1.alpha = 0.3; backgroundContainer.addChild(gradientLayer1); var gradientLayer2 = LK.getAsset('gradientLayer2', { anchorX: 0, anchorY: 0 }); gradientLayer2.x = 0; gradientLayer2.y = 0; gradientLayer2.alpha = 0.2; backgroundContainer.addChild(gradientLayer2); // Animate gradient layers function animateGradientLayers() { // Animate menu background tween(menuBg, { alpha: 0.7 }, { duration: 4000, easing: tween.easeInOut, onFinish: function onFinish() { tween(menuBg, { alpha: 0.9 }, { duration: 4000, easing: tween.easeInOut }); } }); tween(gradientLayer1, { alpha: 0.1 }, { duration: 3000, easing: tween.easeInOut, onFinish: function onFinish() { tween(gradientLayer1, { alpha: 0.3 }, { duration: 3000, easing: tween.easeInOut, onFinish: animateGradientLayers }); } }); tween(gradientLayer2, { alpha: 0.1 }, { duration: 2500, easing: tween.easeInOut, onFinish: function onFinish() { tween(gradientLayer2, { alpha: 0.2 }, { duration: 2500, easing: tween.easeInOut }); } }); } animateGradientLayers(); // Particle system var backgroundParticles = []; var particleSpawnTimer = 0; // Create score display (initially hidden) var scoreTxt = new Text2('0', { size: 100, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); scoreTxt.visible = false; LK.gui.top.addChild(scoreTxt); // Create ball collection display (initially hidden) var ballCountTxt = new Text2('', { size: 50, fill: 0xFFFFFF }); ballCountTxt.anchor.set(1, 0); ballCountTxt.visible = false; LK.gui.topRight.addChild(ballCountTxt); // Create pause button (initially hidden) var pauseButton = new MenuButton('⏸️ DURAKLAT', 0x34495e); pauseButton.x = 150; pauseButton.y = 80; pauseButton.visible = false; pauseButton.onClick = function () { LK.getSound('Click').play(); togglePause(); }; LK.gui.topLeft.addChild(pauseButton); // Game pause state var gamePaused = false; var pauseMenu = null; // Function to update ball collection display function updateBallDisplay() { // Clear existing text and recreate with colored sections if (ballCountTxt.parent) { ballCountTxt.parent.removeChild(ballCountTxt); } // Create container for colored text elements var ballDisplayContainer = new Container(); ballDisplayContainer.x = ballCountTxt.x; ballDisplayContainer.y = ballCountTxt.y; LK.gui.topRight.addChild(ballDisplayContainer); // Title text with enhanced styling var titleText = new Text2('🎯 BÖLÜM ' + currentLevel + ' HEDEFLERİ', { size: 55, fill: 0xf1c40f }); titleText.anchor.set(1, 0); titleText.x = 0; titleText.y = 0; ballDisplayContainer.addChild(titleText); // Add animated glow effect to title tween(titleText, { alpha: 0.7 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(titleText, { alpha: 1 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { // Continue glow animation if still in game if (gameState === 'playing') { tween(titleText, { alpha: 0.7 }, { duration: 1000, easing: tween.easeInOut }); } } }); } }); // Red ball text with red color var redText = new Text2('Kırmızı: ' + ballsCollected.red + '/' + ballRequirements.red, { size: 50, fill: 0xff0000 }); redText.anchor.set(1, 0); redText.x = 0; redText.y = 60; ballDisplayContainer.addChild(redText); // Blue ball text with blue color var blueText = new Text2('Mavi: ' + ballsCollected.blue + '/' + ballRequirements.blue, { size: 50, fill: 0x0066ff }); blueText.anchor.set(1, 0); blueText.x = 0; blueText.y = 120; ballDisplayContainer.addChild(blueText); // Yellow ball text with yellow color var yellowText = new Text2('Sarı: ' + ballsCollected.yellow + '/' + ballRequirements.yellow, { size: 50, fill: 0xffff00 }); yellowText.anchor.set(1, 0); yellowText.x = 0; yellowText.y = 180; ballDisplayContainer.addChild(yellowText); // Add power-up status display if (slowMotionActive || doublePointsActive) { var powerUpStatus = new Text2('', { size: 40, fill: 0xffffff }); powerUpStatus.anchor.set(1, 0); powerUpStatus.x = 0; powerUpStatus.y = 250; var statusText = ''; if (slowMotionActive) { statusText += '🕐 Yavaş Hareket: ' + Math.ceil(slowMotionTimer / 60) + 's\n'; } if (doublePointsActive) { statusText += '⭐ Çift Puan: ' + Math.ceil(doublePointsTimer / 60) + 's\n'; } powerUpStatus.setText(statusText); ballDisplayContainer.addChild(powerUpStatus); } // Update the global reference to the new container ballCountTxt = ballDisplayContainer; } // Initialize menu system function createMainMenu() { gameState = 'menu'; gamePaused = false; // Hide game UI elements scoreTxt.visible = false; ballCountTxt.visible = false; pauseButton.visible = false; // Clean up pause menu if it exists if (pauseMenu) { pauseMenu.destroy(); pauseMenu = null; } // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Play main menu background music if (musicEnabled) { LK.playMusic('Mainmenubackground'); } // Game title var titleText = new Text2('TOPLARI YAKALA', { size: 120, fill: 0xffff00 }); titleText.anchor.set(0.5, 0.5); titleText.x = 2048 / 2; titleText.y = 600; currentMenu.addChild(titleText); // Enhanced title animations with multiple effects var titleColors = [0xfeca57, 0xff9500, 0xff69b4, 0x4da6ff, 0x27ae60, 0xe74c3c]; // Yellow, Orange, Pink, Blue, Green, Red var currentColorIndex = 0; function animateTitle() { // Color cycling animation with faster transitions currentColorIndex = (currentColorIndex + 1) % titleColors.length; tween(titleText, { tint: titleColors[currentColorIndex] }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { animateTitle(); } }); } // Fast yellow blinking animation function yellowBlinkTitle() { tween(titleText, { tint: 0xffff00 }, { duration: 200, easing: tween.linear, onFinish: function onFinish() { tween(titleText, { tint: 0xfeca57 }, { duration: 200, easing: tween.linear, onFinish: yellowBlinkTitle }); } }); } // Pulse effect - continuous scale animation function pulseTitle() { tween(titleText, { scaleX: 1.15, scaleY: 1.15 }, { duration: 1200, easing: tween.easeInOut, onFinish: function onFinish() { tween(titleText, { scaleX: 1, scaleY: 1 }, { duration: 1200, easing: tween.easeInOut, onFinish: pulseTitle }); } }); } // Gentle floating movement with enhanced motion function floatTitle() { var randomY = 600 + (Math.random() - 0.5) * 40; tween(titleText, { y: randomY }, { duration: 3000, easing: tween.easeInOut, onFinish: floatTitle }); } // Rotation effect function rotateTitle() { tween(titleText, { rotation: Math.PI * 0.05 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(titleText, { rotation: -Math.PI * 0.05 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(titleText, { rotation: 0 }, { duration: 1000, easing: tween.easeInOut, onFinish: rotateTitle }); } }); } }); } // Glow effect simulation with alpha changes function glowTitle() { tween(titleText, { alpha: 0.7 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { tween(titleText, { alpha: 1 }, { duration: 800, easing: tween.easeInOut, onFinish: glowTitle }); } }); } // Start all animations animateTitle(); yellowBlinkTitle(); pulseTitle(); floatTitle(); rotateTitle(); glowTitle(); // Menu buttons var startButton = new MenuButton('OYUNU BAŞLAT', 0x27ae60); startButton.x = 2048 / 2; startButton.y = 1000; // Enhanced start button animations // Gradient color animation with multiple colors var startButtonColors = [0x27ae60, 0x2ecc71, 0x1abc9c, 0x16a085, 0x27ae60]; var currentStartColorIndex = 0; function animateStartButton() { currentStartColorIndex = (currentStartColorIndex + 1) % startButtonColors.length; tween(startButton.bg, { tint: startButtonColors[currentStartColorIndex] }, { duration: 800, easing: tween.easeInOut, onFinish: animateStartButton }); } // Pulsing scale animation function pulseStartButton() { tween(startButton, { scaleX: 1.1, scaleY: 1.1 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(startButton, { scaleX: 1, scaleY: 1 }, { duration: 1000, easing: tween.easeInOut, onFinish: pulseStartButton }); } }); } // Glow effect with alpha changes function glowStartButton() { tween(startButton, { alpha: 0.7 }, { duration: 600, easing: tween.easeInOut, onFinish: function onFinish() { tween(startButton, { alpha: 1 }, { duration: 600, easing: tween.easeInOut, onFinish: glowStartButton }); } }); } // Gentle floating movement function floatStartButton() { var randomY = 1000 + (Math.random() - 0.5) * 20; tween(startButton, { y: randomY }, { duration: 2000, easing: tween.easeInOut, onFinish: floatStartButton }); } // Start all animations animateStartButton(); pulseStartButton(); glowStartButton(); floatStartButton(); startButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation tween(startButton, { scaleX: 1.2, scaleY: 1.2, rotation: Math.PI * 0.05 }, { duration: 150, easing: tween.bounceOut, onFinish: function onFinish() { tween(startButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 100, easing: tween.easeOut, onFinish: function onFinish() { startGame(); } }); } }); }; currentMenu.addChild(startButton); var howToPlayButton = new MenuButton('❓ NASIL OYNANIR?', 0x3498db); howToPlayButton.x = 2048 / 2; howToPlayButton.y = 1200; // Enhanced how to play button animations // Question mark pulse animation - makes the button more noticeable function pulseHowToPlayButton() { tween(howToPlayButton, { scaleX: 1.08, scaleY: 1.08 }, { duration: 1200, easing: tween.easeInOut, onFinish: function onFinish() { tween(howToPlayButton, { scaleX: 1, scaleY: 1 }, { duration: 1200, easing: tween.easeInOut, onFinish: pulseHowToPlayButton }); } }); } // Color cycling animation with educational colors var howToPlayColors = [0x3498db, 0x9b59b6, 0x1abc9c, 0xf39c12]; // Blue, Purple, Teal, Orange var currentHowToPlayColorIndex = 0; function animateHowToPlayButton() { currentHowToPlayColorIndex = (currentHowToPlayColorIndex + 1) % howToPlayColors.length; tween(howToPlayButton.bg, { tint: howToPlayColors[currentHowToPlayColorIndex] }, { duration: 1500, easing: tween.easeInOut, onFinish: animateHowToPlayButton }); } // Gentle shake animation to draw attention function shakeHowToPlayButton() { tween(howToPlayButton, { x: 2048 / 2 + 8 }, { duration: 150, easing: tween.easeInOut, onFinish: function onFinish() { tween(howToPlayButton, { x: 2048 / 2 - 8 }, { duration: 150, easing: tween.easeInOut, onFinish: function onFinish() { tween(howToPlayButton, { x: 2048 / 2 }, { duration: 150, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat shake after delay LK.setTimeout(shakeHowToPlayButton, 5000); } }); } }); } }); } // Glow effect for help button function glowHowToPlayButton() { tween(howToPlayButton, { alpha: 0.6 }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { tween(howToPlayButton, { alpha: 1 }, { duration: 800, easing: tween.easeInOut, onFinish: glowHowToPlayButton }); } }); } // Start all animations pulseHowToPlayButton(); animateHowToPlayButton(); glowHowToPlayButton(); // Start shake animation after a delay LK.setTimeout(shakeHowToPlayButton, 3000); howToPlayButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with question mark theme tween(howToPlayButton, { scaleX: 1.3, scaleY: 1.3, rotation: Math.PI * 0.1 }, { duration: 200, easing: tween.bounceOut, onFinish: function onFinish() { tween(howToPlayButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { showHowToPlay(); } }); } }); }; currentMenu.addChild(howToPlayButton); var statisticsButton = new MenuButton('📊 İSTATİSTİKLERİM', 0x6c5ce7); statisticsButton.x = 2048 / 2; statisticsButton.y = 1350; // Enhanced statistics button animations // Data visualization effect with color cycling var statisticsColors = [0x6c5ce7, 0x9b59b6, 0x3498db, 0x1abc9c]; // Purple, Violet, Blue, Teal var currentStatsColorIndex = 0; function animateStatisticsButton() { currentStatsColorIndex = (currentStatsColorIndex + 1) % statisticsColors.length; tween(statisticsButton.bg, { tint: statisticsColors[currentStatsColorIndex] }, { duration: 1800, easing: tween.easeInOut, onFinish: animateStatisticsButton }); } // Chart-like pulse animation function pulseStatisticsButton() { tween(statisticsButton, { scaleX: 1.06, scaleY: 1.06 }, { duration: 1400, easing: tween.easeInOut, onFinish: function onFinish() { tween(statisticsButton, { scaleX: 1, scaleY: 1 }, { duration: 1400, easing: tween.easeInOut, onFinish: pulseStatisticsButton }); } }); } // Data bar effect simulation with gentle shake function shakeStatisticsButton() { tween(statisticsButton, { x: 2048 / 2 + 6 }, { duration: 100, easing: tween.easeInOut, onFinish: function onFinish() { tween(statisticsButton, { x: 2048 / 2 - 6 }, { duration: 100, easing: tween.easeInOut, onFinish: function onFinish() { tween(statisticsButton, { x: 2048 / 2 }, { duration: 100, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat shake after delay LK.setTimeout(shakeStatisticsButton, 4000); } }); } }); } }); } // Glow effect for data visualization theme function glowStatisticsButton() { tween(statisticsButton, { alpha: 0.75 }, { duration: 700, easing: tween.easeInOut, onFinish: function onFinish() { tween(statisticsButton, { alpha: 1 }, { duration: 700, easing: tween.easeInOut, onFinish: glowStatisticsButton }); } }); } // Start all animations animateStatisticsButton(); pulseStatisticsButton(); glowStatisticsButton(); // Start shake animation after a delay LK.setTimeout(shakeStatisticsButton, 2000); statisticsButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with chart theme tween(statisticsButton, { scaleX: 1.25, scaleY: 1.25, rotation: Math.PI * 0.08 }, { duration: 180, easing: tween.bounceOut, onFinish: function onFinish() { tween(statisticsButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 120, easing: tween.easeOut, onFinish: function onFinish() { showStatistics(); } }); } }); }; currentMenu.addChild(statisticsButton); var settingsButton = new MenuButton('⚙️ AYARLAR', 0xf39c12); settingsButton.x = 2048 / 2; settingsButton.y = 1500; // Enhanced settings button animations // Gear rotation effect function rotateSettingsButton() { tween(settingsButton, { rotation: Math.PI * 0.05 }, { duration: 2000, easing: tween.easeInOut, onFinish: function onFinish() { tween(settingsButton, { rotation: -Math.PI * 0.05 }, { duration: 2000, easing: tween.easeInOut, onFinish: function onFinish() { tween(settingsButton, { rotation: 0 }, { duration: 1500, easing: tween.easeInOut, onFinish: rotateSettingsButton }); } }); } }); } // Mechanical color cycling var settingsColors = [0xf39c12, 0xe67e22, 0xd35400, 0x95a5a6]; // Orange, Dark Orange, Darker Orange, Gray var currentSettingsColorIndex = 0; function animateSettingsButton() { currentSettingsColorIndex = (currentSettingsColorIndex + 1) % settingsColors.length; tween(settingsButton.bg, { tint: settingsColors[currentSettingsColorIndex] }, { duration: 1600, easing: tween.easeInOut, onFinish: animateSettingsButton }); } // Mechanical pulse animation function pulseSettingsButton() { tween(settingsButton, { scaleX: 1.08, scaleY: 1.08 }, { duration: 1300, easing: tween.easeInOut, onFinish: function onFinish() { tween(settingsButton, { scaleX: 1, scaleY: 1 }, { duration: 1300, easing: tween.easeInOut, onFinish: pulseSettingsButton }); } }); } // Gear-like glow effect function glowSettingsButton() { tween(settingsButton, { alpha: 0.7 }, { duration: 900, easing: tween.easeInOut, onFinish: function onFinish() { tween(settingsButton, { alpha: 1 }, { duration: 900, easing: tween.easeInOut, onFinish: glowSettingsButton }); } }); } // Start all animations rotateSettingsButton(); animateSettingsButton(); pulseSettingsButton(); glowSettingsButton(); settingsButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with gear theme tween(settingsButton, { scaleX: 1.3, scaleY: 1.3, rotation: Math.PI * 0.5 }, { duration: 200, easing: tween.bounceOut, onFinish: function onFinish() { tween(settingsButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 150, easing: tween.easeOut, onFinish: function onFinish() { showSettings(); } }); } }); }; currentMenu.addChild(settingsButton); var creatorsButton = new MenuButton('🎬 YAPIMCILAR', 0x9b59b6); creatorsButton.x = 2048 / 2; creatorsButton.y = 1650; // Enhanced creators button animations // Film reel color cycling var creatorsColors = [0x9b59b6, 0x8e44ad, 0x3498db, 0xe74c3c]; // Purple, Dark Purple, Blue, Red var currentCreatorsColorIndex = 0; function animateCreatorsButton() { currentCreatorsColorIndex = (currentCreatorsColorIndex + 1) % creatorsColors.length; tween(creatorsButton.bg, { tint: creatorsColors[currentCreatorsColorIndex] }, { duration: 2000, easing: tween.easeInOut, onFinish: animateCreatorsButton }); } // Movie credits roll effect function rollCreatorsButton() { tween(creatorsButton, { y: 1650 - 15 }, { duration: 1800, easing: tween.easeInOut, onFinish: function onFinish() { tween(creatorsButton, { y: 1650 + 15 }, { duration: 1800, easing: tween.easeInOut, onFinish: function onFinish() { tween(creatorsButton, { y: 1650 }, { duration: 1200, easing: tween.easeInOut, onFinish: rollCreatorsButton }); } }); } }); } // Film camera pulse effect function pulseCreatorsButton() { tween(creatorsButton, { scaleX: 1.07, scaleY: 1.07 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(creatorsButton, { scaleX: 1, scaleY: 1 }, { duration: 1500, easing: tween.easeInOut, onFinish: pulseCreatorsButton }); } }); } // Spotlight glow effect function glowCreatorsButton() { tween(creatorsButton, { alpha: 0.6 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(creatorsButton, { alpha: 1 }, { duration: 1000, easing: tween.easeInOut, onFinish: glowCreatorsButton }); } }); } // Start all animations animateCreatorsButton(); rollCreatorsButton(); pulseCreatorsButton(); glowCreatorsButton(); creatorsButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with film theme tween(creatorsButton, { scaleX: 1.4, scaleY: 1.4, rotation: Math.PI * 0.15 }, { duration: 250, easing: tween.bounceOut, onFinish: function onFinish() { tween(creatorsButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 200, easing: tween.easeOut, onFinish: function onFinish() { showCreators(); } }); } }); }; currentMenu.addChild(creatorsButton); var recentUpdatesButton = new MenuButton('🆕 OYUNA SON EKLENENLER', 0x1abc9c); recentUpdatesButton.x = 2048 / 2; recentUpdatesButton.y = 1800; // Enhanced recent updates button animations // Notification badge flash effect var updatesColors = [0x1abc9c, 0x16a085, 0xe74c3c, 0xf1c40f]; // Teal, Dark Teal, Red, Yellow var currentUpdatesColorIndex = 0; function animateUpdatesButton() { currentUpdatesColorIndex = (currentUpdatesColorIndex + 1) % updatesColors.length; tween(recentUpdatesButton.bg, { tint: updatesColors[currentUpdatesColorIndex] }, { duration: 1200, easing: tween.easeInOut, onFinish: animateUpdatesButton }); } // New content notification pulse function pulseUpdatesButton() { tween(recentUpdatesButton, { scaleX: 1.12, scaleY: 1.12 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(recentUpdatesButton, { scaleX: 1, scaleY: 1 }, { duration: 1000, easing: tween.easeInOut, onFinish: pulseUpdatesButton }); } }); } // Notification glow effect with stronger intensity function glowUpdatesButton() { tween(recentUpdatesButton, { alpha: 0.5 }, { duration: 600, easing: tween.easeInOut, onFinish: function onFinish() { tween(recentUpdatesButton, { alpha: 1 }, { duration: 600, easing: tween.easeInOut, onFinish: glowUpdatesButton }); } }); } // New badge shake animation function shakeUpdatesButton() { tween(recentUpdatesButton, { x: 2048 / 2 + 10 }, { duration: 120, easing: tween.easeInOut, onFinish: function onFinish() { tween(recentUpdatesButton, { x: 2048 / 2 - 10 }, { duration: 120, easing: tween.easeInOut, onFinish: function onFinish() { tween(recentUpdatesButton, { x: 2048 / 2 }, { duration: 120, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat shake after delay LK.setTimeout(shakeUpdatesButton, 6000); } }); } }); } }); } // Start all animations animateUpdatesButton(); pulseUpdatesButton(); glowUpdatesButton(); // Start shake animation after a delay LK.setTimeout(shakeUpdatesButton, 3500); recentUpdatesButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with notification theme tween(recentUpdatesButton, { scaleX: 1.35, scaleY: 1.35, rotation: Math.PI * 0.12 }, { duration: 220, easing: tween.bounceOut, onFinish: function onFinish() { tween(recentUpdatesButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 180, easing: tween.easeOut, onFinish: function onFinish() { showRecentUpdates(); } }); } }); }; currentMenu.addChild(recentUpdatesButton); var exitButton = new MenuButton('🚪 ÇIKIŞ', 0xe74c3c); exitButton.x = 2048 / 2; exitButton.y = 1950; // Enhanced exit button animations // Warning color cycling var exitColors = [0xe74c3c, 0xc0392b, 0x95a5a6, 0x34495e]; // Red, Dark Red, Gray, Dark Gray var currentExitColorIndex = 0; function animateExitButton() { currentExitColorIndex = (currentExitColorIndex + 1) % exitColors.length; tween(exitButton.bg, { tint: exitColors[currentExitColorIndex] }, { duration: 2200, easing: tween.easeInOut, onFinish: animateExitButton }); } // Warning pulse with stronger effect function pulseExitButton() { tween(exitButton, { scaleX: 1.05, scaleY: 1.05 }, { duration: 1600, easing: tween.easeInOut, onFinish: function onFinish() { tween(exitButton, { scaleX: 1, scaleY: 1 }, { duration: 1600, easing: tween.easeInOut, onFinish: pulseExitButton }); } }); } // Danger glow effect function glowExitButton() { tween(exitButton, { alpha: 0.8 }, { duration: 1100, easing: tween.easeInOut, onFinish: function onFinish() { tween(exitButton, { alpha: 1 }, { duration: 1100, easing: tween.easeInOut, onFinish: glowExitButton }); } }); } // Warning door close effect function doorExitButton() { tween(exitButton, { y: 1950 - 8 }, { duration: 2500, easing: tween.easeInOut, onFinish: function onFinish() { tween(exitButton, { y: 1950 + 8 }, { duration: 2500, easing: tween.easeInOut, onFinish: function onFinish() { tween(exitButton, { y: 1950 }, { duration: 2000, easing: tween.easeInOut, onFinish: doorExitButton }); } }); } }); } // Start all animations animateExitButton(); pulseExitButton(); glowExitButton(); doorExitButton(); exitButton.onClick = function () { LK.getSound('Click').play(); // Enhanced click animation with door/warning theme tween(exitButton, { scaleX: 1.2, scaleY: 1.2, rotation: Math.PI * 0.06 }, { duration: 160, easing: tween.bounceOut, onFinish: function onFinish() { tween(exitButton, { scaleX: 1, scaleY: 1, rotation: 0 }, { duration: 140, easing: tween.easeOut, onFinish: function onFinish() { // On mobile, we can't actually exit, so show a message LK.effects.flashScreen(0x000000, 1000); } }); } }); }; currentMenu.addChild(exitButton); } function togglePause() { if (gameState !== 'playing') return; gamePaused = !gamePaused; pauseButton.text.setText(gamePaused ? '▶️ DEVAM' : '⏸️ DURAKLAT'); pauseButton.bg.tint = gamePaused ? 0x27ae60 : 0x34495e; if (gamePaused) { // Show pause menu pauseMenu = new Container(); game.addChild(pauseMenu); // Semi-transparent overlay var overlay = LK.getAsset('shape', { width: 2048, height: 2732, color: 0x000000, shape: 'box', anchorX: 0, anchorY: 0 }); overlay.alpha = 0.7; pauseMenu.addChild(overlay); // Pause title var pauseTitle = new Text2('OYUN DURAKLATILDI', { size: 80, fill: 0xFFFFFF }); pauseTitle.anchor.set(0.5, 0.5); pauseTitle.x = 2048 / 2; pauseTitle.y = 800; pauseMenu.addChild(pauseTitle); // Resume button var resumeButton = new MenuButton('▶️ DEVAM ET', 0x27ae60); resumeButton.x = 2048 / 2; resumeButton.y = 1200; resumeButton.onClick = function () { LK.getSound('Click').play(); togglePause(); }; pauseMenu.addChild(resumeButton); // Main menu button var mainMenuButton = new MenuButton('🏠 ANA MENÜ', 0xe74c3c); mainMenuButton.x = 2048 / 2; mainMenuButton.y = 1400; mainMenuButton.onClick = function () { LK.getSound('Click').play(); // Save game time before going to menu if (sessionStartTime > 0) { var sessionTime = Math.floor((Date.now() - sessionStartTime) / 1000); totalGameTime = (storage.totalGameTime || 0) + sessionTime; storage.totalGameTime = totalGameTime; sessionStartTime = 0; } // Save high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; } gamePaused = false; pauseMenu.destroy(); pauseMenu = null; pauseButton.visible = false; createMainMenu(); }; pauseMenu.addChild(mainMenuButton); // Settings button var settingsInGameButton = new MenuButton('⚙️ AYARLAR', 0xf39c12); settingsInGameButton.x = 2048 / 2; settingsInGameButton.y = 1600; settingsInGameButton.onClick = function () { LK.getSound('Click').play(); showSettings(); }; pauseMenu.addChild(settingsInGameButton); } else { // Hide pause menu if (pauseMenu) { pauseMenu.destroy(); pauseMenu = null; } } } function startGame() { gameState = 'countdown'; gamePaused = false; // Clear menu if (currentMenu) { currentMenu.destroy(); currentMenu = null; } // Start countdown sequence startCountdown(); } function startCountdown() { // Create countdown container var countdownContainer = new Container(); game.addChild(countdownContainer); // Create semi-transparent overlay var overlay = LK.getAsset('shape', { width: 2048, height: 2732, color: 0x000000, shape: 'box', anchorX: 0, anchorY: 0 }); overlay.alpha = 0.7; countdownContainer.addChild(overlay); // Countdown numbers var countdownNumbers = ['3', '2', '1', 'BAŞLA!']; var currentIndex = 0; function showNextNumber() { if (currentIndex >= countdownNumbers.length) { // Countdown finished, start actual game countdownContainer.destroy(); actuallyStartGame(); return; } // Create countdown text var countdownText = new Text2(countdownNumbers[currentIndex], { size: currentIndex === 3 ? 100 : 200, fill: currentIndex === 3 ? 0x27ae60 : 0xf1c40f }); countdownText.anchor.set(0.5, 0.5); countdownText.x = 2048 / 2; countdownText.y = 2732 / 2; countdownContainer.addChild(countdownText); // Initial animation - start big and fade in countdownText.scaleX = 3; countdownText.scaleY = 3; countdownText.alpha = 0; // Play countdown sound LK.getSound('Click').play(); // Animate the number tween(countdownText, { scaleX: 1, scaleY: 1, alpha: 1 }, { duration: 300, easing: tween.bounceOut, onFinish: function onFinish() { // Hold for a moment then shrink and fade out LK.setTimeout(function () { tween(countdownText, { scaleX: 0.5, scaleY: 0.5, alpha: 0, rotation: Math.PI * 0.1 }, { duration: 200, easing: tween.easeIn, onFinish: function onFinish() { countdownText.destroy(); currentIndex++; showNextNumber(); } }); }, currentIndex === 3 ? 500 : 700); // Hold "BAŞLA!" longer } }); // Add pulsing glow effect function pulseGlow() { if (countdownText.parent) { tween(countdownText, { tint: 0xffffff }, { duration: 200, easing: tween.easeInOut, onFinish: function onFinish() { if (countdownText.parent) { tween(countdownText, { tint: currentIndex === 3 ? 0x27ae60 : 0xf1c40f }, { duration: 200, easing: tween.easeInOut }); } } }); } } // Start glow effect after initial animation LK.setTimeout(pulseGlow, 350); } // Start the countdown showNextNumber(); } function actuallyStartGame() { gameState = 'playing'; // Show score and ball collection display scoreTxt.visible = true; ballCountTxt.visible = true; pauseButton.visible = true; pauseButton.text.setText('⏸️ DURAKLAT'); pauseButton.bg.tint = 0x34495e; updateBallDisplay(); // Clear existing baskets before creating new ones for (var i = baskets.length - 1; i >= 0; i--) { baskets[i].destroy(); } baskets = []; // Create baskets for (var i = 0; i < 3; i++) { var basket = new Basket(colors[i]); basket.x = 2048 / 4 * (i + 1); basket.y = 2732 - 200; baskets.push(basket); game.addChild(basket); } // Start background music only if enabled if (musicEnabled) { LK.playMusic('Background'); } // Start tracking game time for this session sessionStartTime = Date.now(); currentSessionStartTime = sessionStartTime; // Reset game variables and apply settings // Apply difficulty level var baseSpeed = difficultyLevel === 'Easy' ? 0.5 : difficultyLevel === 'Hard' ? 1.5 : 1.0; // Apply game speed setting var speedMultiplier = gameSpeedSetting === 'Slow' ? 0.7 : gameSpeedSetting === 'Fast' ? 1.3 : 1.0; gameSpeed = baseSpeed * speedMultiplier; consecutiveMatches = 0; LK.setScore(0); scoreTxt.setText('0'); // Reset power-ups slowMotionActive = false; doublePointsActive = false; slowMotionTimer = 0; doublePointsTimer = 0; powerUpSpawnTimer = 0; // Clear existing power-ups for (var p = powerUps.length - 1; p >= 0; p--) { powerUps[p].destroy(); } powerUps = []; // Reset ball collection for new game ballsCollected.red = 0; ballsCollected.blue = 0; ballsCollected.yellow = 0; storage.redBallsCollected = 0; storage.blueBallsCollected = 0; storage.yellowBallsCollected = 0; // Reset level completion status levelCompleted = false; // Reset level to 1 currentLevel = 1; storage.currentLevel = 1; } function showHowToPlay() { gameState = 'howtoplay'; // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Title var titleText = new Text2('NASIL OYNANIR', { size: 80, fill: 0xff6b6b }); titleText.anchor.set(0.5, 0.5); titleText.x = 2048 / 2; titleText.y = 400; currentMenu.addChild(titleText); // Game objective section var objectiveText = new Text2('🎯 OYUNUN AMACI', { size: 60, fill: 0xf1c40f }); objectiveText.anchor.set(0.5, 0.5); objectiveText.x = 2048 / 2; objectiveText.y = 580; currentMenu.addChild(objectiveText); var objectiveDesc = new Text2('Yukarıdan düşen renkli şekilleri aynı renkteki sepetlerle yakalayın!\nDoğru renk eşleştirmeleri yaparak puan kazanın.', { size: 45, fill: 0xFFFFFF }); objectiveDesc.anchor.set(0.5, 0.5); objectiveDesc.x = 2048 / 2; objectiveDesc.y = 700; currentMenu.addChild(objectiveDesc); // Level system section var levelText = new Text2('🎮 BÖLÜM SİSTEMİ', { size: 60, fill: 0x3498db }); levelText.anchor.set(0.5, 0.5); levelText.x = 2048 / 2; levelText.y = 850; currentMenu.addChild(levelText); var levelDesc = new Text2('• BÖLÜM 1: Her renkten 5 top toplayın\n• BÖLÜM 2: Her renkten 10 top toplayın (SON BÖLÜM)\n• Her bölümde oyun daha da hızlanır!', { size: 40, fill: 0xFFFFFF }); levelDesc.anchor.set(0.5, 0.5); levelDesc.x = 2048 / 2; levelDesc.y = 970; currentMenu.addChild(levelDesc); // Controls section var controlsText = new Text2('📱 KONTROLLER', { size: 60, fill: 0x27ae60 }); controlsText.anchor.set(0.5, 0.5); controlsText.x = 2048 / 2; controlsText.y = 1120; currentMenu.addChild(controlsText); var controlsDesc = new Text2('• Sepetleri parmağınızla dokunup sürükleyin\n• Sepetler sadece sağa-sola hareket eder\n• Sepeti dokunduğunuz yere getirin', { size: 40, fill: 0xFFFFFF }); controlsDesc.anchor.set(0.5, 0.5); controlsDesc.x = 2048 / 2; controlsDesc.y = 1240; currentMenu.addChild(controlsDesc); // Scoring section var scoringText = new Text2('🏆 PUANLAMA SİSTEMİ', { size: 60, fill: 0xe67e22 }); scoringText.anchor.set(0.5, 0.5); scoringText.x = 2048 / 2; scoringText.y = 1390; currentMenu.addChild(scoringText); var scoringDesc = new Text2('• Doğru renk eşleştirme: +10 puan\n• Ardışık başarılı yakalamalar BONUS puan verir\n• Ne kadar çok yakalarsanız o kadar fazla puan!', { size: 40, fill: 0xFFFFFF }); scoringDesc.anchor.set(0.5, 0.5); scoringDesc.x = 2048 / 2; scoringDesc.y = 1510; currentMenu.addChild(scoringDesc); // Game over conditions var gameOverText = new Text2('❌ OYUN NASIL BİTER?', { size: 60, fill: 0xe74c3c }); gameOverText.anchor.set(0.5, 0.5); gameOverText.x = 2048 / 2; gameOverText.y = 1660; currentMenu.addChild(gameOverText); var gameOverDesc = new Text2('• Yanlış renkli sepete şekil düşürürseniz GAME OVER!\n• Herhangi bir şekli kaçırırsanız (yere düşerse) GAME OVER!\n• DİKKAT: Oyun sürekli hızlanır!', { size: 40, fill: 0xFFFFFF }); gameOverDesc.anchor.set(0.5, 0.5); gameOverDesc.x = 2048 / 2; gameOverDesc.y = 1780; currentMenu.addChild(gameOverDesc); // Tips section var tipsText = new Text2('💡 PRO İPUÇLARI', { size: 60, fill: 0x9b59b6 }); tipsText.anchor.set(0.5, 0.5); tipsText.x = 2048 / 2; tipsText.y = 1930; currentMenu.addChild(tipsText); var tipsDesc = new Text2('• Sepetleri şekil gelmeden ÖNCE konumlandırın\n• Hızlanan oyuna hazırlıklı olun\n• AYARLAR menüsünden zorluk seviyesini ayarlayın\n• Konsantre olun ve sakin kalın!', { size: 40, fill: 0xFFFFFF }); tipsDesc.anchor.set(0.5, 0.5); tipsDesc.x = 2048 / 2; tipsDesc.y = 2070; currentMenu.addChild(tipsDesc); // Enhanced back button with improved styling var backButton = new MenuButton('⬅ ANA MENÜYE DÖN', 0x34495e); backButton.x = 2048 / 2; backButton.y = 2300; // Add subtle animation to the back button tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(backButton, { alpha: 1 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat animation if (gameState === 'howtoplay') { tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut }); } } }); } }); backButton.onClick = function () { LK.getSound('Click').play(); // Add visual feedback on click tween(backButton.bg, { tint: 0x2c3e50 }, { duration: 100, onFinish: function onFinish() { tween(backButton.bg, { tint: 0x34495e }, { duration: 100 }); } }); createMainMenu(); }; currentMenu.addChild(backButton); } function showSettings() { gameState = 'settings'; // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Settings title var settingsText = new Text2('AYARLAR', { size: 80, fill: 0xFFFFFF }); settingsText.anchor.set(0.5, 0.5); settingsText.x = 2048 / 2; settingsText.y = 500; currentMenu.addChild(settingsText); // Music toggle button var musicButton = new MenuButton(musicEnabled ? 'Oyun başlayınca arka plan müziği: açık' : 'Oyun başlayınca arka plan müziği: kapalı', musicEnabled ? 0x27ae60 : 0xe74c3c); musicButton.x = 2048 / 2; musicButton.y = 700; musicButton.onClick = function () { LK.getSound('Click').play(); musicEnabled = !musicEnabled; storage.musicEnabled = musicEnabled; // Save music preference if (musicEnabled) { LK.playMusic('Background'); musicButton.text.setText('Oyun başlayınca arka plan müziği: açık'); musicButton.bg.tint = 0x27ae60; } else { LK.stopMusic(); musicButton.text.setText('Oyun başlayınca arka plan müziği: kapalı'); musicButton.bg.tint = 0xe74c3c; } }; currentMenu.addChild(musicButton); // Difficulty Level button var difficultyButton = new MenuButton('Zorluk: ' + difficultyLevel, 0x8e44ad); difficultyButton.x = 2048 / 2; difficultyButton.y = 900; difficultyButton.onClick = function () { LK.getSound('Click').play(); var levels = ['Easy', 'Normal', 'Hard']; var currentIndex = levels.indexOf(difficultyLevel); difficultyLevel = levels[(currentIndex + 1) % levels.length]; storage.difficultyLevel = difficultyLevel; difficultyButton.text.setText('Zorluk: ' + difficultyLevel); var colors = [0x27ae60, 0xf39c12, 0xe74c3c]; difficultyButton.bg.tint = colors[levels.indexOf(difficultyLevel)]; }; currentMenu.addChild(difficultyButton); // Game Speed button var speedButton = new MenuButton('Hız: ' + gameSpeedSetting, 0x3498db); speedButton.x = 2048 / 2; speedButton.y = 1100; speedButton.onClick = function () { LK.getSound('Click').play(); var speeds = ['Slow', 'Normal', 'Fast']; var currentIndex = speeds.indexOf(gameSpeedSetting); gameSpeedSetting = speeds[(currentIndex + 1) % speeds.length]; storage.gameSpeedSetting = gameSpeedSetting; speedButton.text.setText('Hız: ' + gameSpeedSetting); var colors = [0x95a5a6, 0x3498db, 0xe67e22]; speedButton.bg.tint = colors[speeds.indexOf(gameSpeedSetting)]; }; currentMenu.addChild(speedButton); // Color Mode button var colorButton = new MenuButton('Renk: ' + colorMode, 0x16a085); colorButton.x = 2048 / 2; colorButton.y = 1300; colorButton.onClick = function () { LK.getSound('Click').play(); var modes = ['Normal', 'ColorBlind']; var currentIndex = modes.indexOf(colorMode); colorMode = modes[(currentIndex + 1) % modes.length]; storage.colorMode = colorMode; colorButton.text.setText('Renk: ' + colorMode); colorButton.bg.tint = colorMode === 'Normal' ? 0x16a085 : 0x34495e; }; currentMenu.addChild(colorButton); // Shape Size button var sizeButton = new MenuButton('Boyut: ' + shapeSize, 0xd35400); sizeButton.x = 2048 / 2; sizeButton.y = 1500; sizeButton.onClick = function () { LK.getSound('Click').play(); var sizes = ['Small', 'Normal', 'Large']; var currentIndex = sizes.indexOf(shapeSize); shapeSize = sizes[(currentIndex + 1) % sizes.length]; storage.shapeSize = shapeSize; sizeButton.text.setText('Boyut: ' + shapeSize); var colors = [0x95a5a6, 0xd35400, 0x8e44ad]; sizeButton.bg.tint = colors[sizes.indexOf(shapeSize)]; }; currentMenu.addChild(sizeButton); // Graphics settings section title var graphicsTitle = new Text2('🎨 GRAFİK AYARLARI', { size: 60, fill: 0xff6b6b }); graphicsTitle.anchor.set(0.5, 0.5); graphicsTitle.x = 2048 / 2; graphicsTitle.y = 1650; currentMenu.addChild(graphicsTitle); // Particle effects button var particleEffectsEnabled = storage.particleEffectsEnabled !== undefined ? storage.particleEffectsEnabled : true; var particleButton = new MenuButton(particleEffectsEnabled ? '✨ Partikül Efektleri: Açık' : '✨ Partikül Efektleri: Kapalı', particleEffectsEnabled ? 0x27ae60 : 0xe74c3c); particleButton.x = 2048 / 2; particleButton.y = 1800; particleButton.onClick = function () { LK.getSound('Click').play(); particleEffectsEnabled = !particleEffectsEnabled; storage.particleEffectsEnabled = particleEffectsEnabled; if (particleEffectsEnabled) { particleButton.text.setText('✨ Partikül Efektleri: Açık'); particleButton.bg.tint = 0x27ae60; } else { particleButton.text.setText('✨ Partikül Efektleri: Kapalı'); particleButton.bg.tint = 0xe74c3c; } }; currentMenu.addChild(particleButton); // Screen effects button var screenEffectsEnabled = storage.screenEffectsEnabled !== undefined ? storage.screenEffectsEnabled : true; var screenButton = new MenuButton(screenEffectsEnabled ? '💥 Ekran Efektleri: Açık' : '💥 Ekran Efektleri: Kapalı', screenEffectsEnabled ? 0x27ae60 : 0xe74c3c); screenButton.x = 2048 / 2; screenButton.y = 1950; screenButton.onClick = function () { LK.getSound('Click').play(); screenEffectsEnabled = !screenEffectsEnabled; storage.screenEffectsEnabled = screenEffectsEnabled; if (screenEffectsEnabled) { screenButton.text.setText('💥 Ekran Efektleri: Açık'); screenButton.bg.tint = 0x27ae60; } else { screenButton.text.setText('💥 Ekran Efektleri: Kapalı'); screenButton.bg.tint = 0xe74c3c; } }; currentMenu.addChild(screenButton); // Animation quality button var animationQuality = storage.animationQuality || 'High'; var animationButton = new MenuButton('🎭 Animasyon Kalitesi: ' + animationQuality, 0x9b59b6); animationButton.x = 2048 / 2; animationButton.y = 2100; animationButton.onClick = function () { LK.getSound('Click').play(); var qualities = ['Low', 'Medium', 'High']; var currentIndex = qualities.indexOf(animationQuality); animationQuality = qualities[(currentIndex + 1) % qualities.length]; storage.animationQuality = animationQuality; animationButton.text.setText('🎭 Animasyon Kalitesi: ' + animationQuality); var colors = [0x95a5a6, 0xf39c12, 0x9b59b6]; animationButton.bg.tint = colors[qualities.indexOf(animationQuality)]; }; currentMenu.addChild(animationButton); // Enhanced back button with improved styling var backButton = new MenuButton('⬅ ANA MENÜYE DÖN', 0x34495e); backButton.x = 2048 / 2; backButton.y = 2250; // Add subtle animation to the back button tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(backButton, { alpha: 1 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat animation if (gameState === 'settings') { tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut }); } } }); } }); backButton.onClick = function () { LK.getSound('Click').play(); // Add visual feedback on click tween(backButton.bg, { tint: 0x2c3e50 }, { duration: 100, onFinish: function onFinish() { tween(backButton.bg, { tint: 0x34495e }, { duration: 100 }); } }); createMainMenu(); }; currentMenu.addChild(backButton); } function showStatistics() { gameState = 'statistics'; // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Statistics title var statisticsTitle = new Text2('İSTATİSTİKLERİM', { size: 80, fill: 0x6c5ce7 }); statisticsTitle.anchor.set(0.5, 0.5); statisticsTitle.x = 2048 / 2; statisticsTitle.y = 500; currentMenu.addChild(statisticsTitle); // High score section var highScoreTitle = new Text2('🏆 EN YÜKSEK SKOR', { size: 60, fill: 0xf1c40f }); highScoreTitle.anchor.set(0.5, 0.5); highScoreTitle.x = 2048 / 2; highScoreTitle.y = 700; currentMenu.addChild(highScoreTitle); var highScoreValue = new Text2(highScore.toString(), { size: 80, fill: 0xFFFFFF }); highScoreValue.anchor.set(0.5, 0.5); highScoreValue.x = 2048 / 2; highScoreValue.y = 800; currentMenu.addChild(highScoreValue); // Total game time section var gameTimeTitle = new Text2('⏰ TOPLAM OYUN SÜRESİ', { size: 60, fill: 0x9b59b6 }); gameTimeTitle.anchor.set(0.5, 0.5); gameTimeTitle.x = 2048 / 2; gameTimeTitle.y = 1000; currentMenu.addChild(gameTimeTitle); // Get the most current total time from storage var currentTotalTime = storage.totalGameTime || 0; var gameTimeValue = new Text2(formatGameTime(currentTotalTime), { size: 70, fill: 0xFFFFFF }); gameTimeValue.anchor.set(0.5, 0.5); gameTimeValue.x = 2048 / 2; gameTimeValue.y = 1120; currentMenu.addChild(gameTimeValue); // Achievement section var achievementsTitle = new Text2('🎯 BAŞARILARINIZ', { size: 60, fill: 0x27ae60 }); achievementsTitle.anchor.set(0.5, 0.5); achievementsTitle.x = 2048 / 2; achievementsTitle.y = 1320; currentMenu.addChild(achievementsTitle); // Show achievements based on high score var achievementText = ''; if (highScore >= 1000) { achievementText = '• Efsane Oyuncu: 1000+ puan\n• Usta Oyuncu: 500+ puan\n• Deneyimli Oyuncu: 100+ puan\n• Başlangıç: İlk oyun'; } else if (highScore >= 500) { achievementText = '• Usta Oyuncu: 500+ puan\n• Deneyimli Oyuncu: 100+ puan\n• Başlangıç: İlk oyun'; } else if (highScore >= 100) { achievementText = '• Deneyimli Oyuncu: 100+ puan\n• Başlangıç: İlk oyun'; } else if (highScore > 0) { achievementText = '• Başlangıç: İlk oyun'; } else { achievementText = 'Henüz hiç oynamadınız!\nOyuna başlayarak ilk başarımınızı kazanın.'; } var achievementsList = new Text2(achievementText, { size: 45, fill: 0xecf0f1 }); achievementsList.anchor.set(0.5, 0.5); achievementsList.x = 2048 / 2; achievementsList.y = 1480; currentMenu.addChild(achievementsList); // Progress section var progressTitle = new Text2('📊 SONRAKI BAŞARIM', { size: 60, fill: 0x3498db }); progressTitle.anchor.set(0.5, 0.5); progressTitle.x = 2048 / 2; progressTitle.y = 1680; currentMenu.addChild(progressTitle); var nextGoal = ''; if (highScore < 100) { nextGoal = 'Deneyimli Oyuncu için ' + (100 - highScore) + ' puan daha'; } else if (highScore < 500) { nextGoal = 'Usta Oyuncu için ' + (500 - highScore) + ' puan daha'; } else if (highScore < 1000) { nextGoal = 'Efsane Oyuncu için ' + (1000 - highScore) + ' puan daha'; } else { nextGoal = 'Tüm başarımları tamamladınız!'; } var nextGoalText = new Text2(nextGoal, { size: 50, fill: 0xbdc3c7 }); nextGoalText.anchor.set(0.5, 0.5); nextGoalText.x = 2048 / 2; nextGoalText.y = 1780; currentMenu.addChild(nextGoalText); // Back button var backButton = new MenuButton('⬅ ANA MENÜYE DÖN', 0x34495e); backButton.x = 2048 / 2; backButton.y = 2000; backButton.onClick = function () { LK.getSound('Click').play(); createMainMenu(); }; currentMenu.addChild(backButton); } function showCreators() { gameState = 'creators'; // Stop background music and play Creators music LK.stopMusic(); LK.playMusic('Creators'); // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Creators title with animated styling var creatorsTitle = new Text2('🎮 YAPIMCILAR 🎮', { size: 90, fill: 0xff6b6b }); creatorsTitle.anchor.set(0.5, 0.5); creatorsTitle.x = 2048 / 2; creatorsTitle.y = 500; currentMenu.addChild(creatorsTitle); // Animate title with color cycling var titleColors = [0xff6b6b, 0xfeca57, 0x4da6ff, 0x9b59b6]; // Red, Yellow, Blue, Purple var currentColorIndex = 0; function animateCreatorsTitle() { currentColorIndex = (currentColorIndex + 1) % titleColors.length; tween(creatorsTitle, { tint: titleColors[currentColorIndex], scaleX: 1.1, scaleY: 1.1 }, { duration: 1000, easing: tween.easeInOut, onFinish: function onFinish() { tween(creatorsTitle, { scaleX: 1, scaleY: 1 }, { duration: 500, onFinish: animateCreatorsTitle }); } }); } animateCreatorsTitle(); // Game development section var gameDevTitle = new Text2('🎯 OYUN GELİŞTİRME EKİBİ', { size: 65, fill: 0xf1c40f }); gameDevTitle.anchor.set(0.5, 0.5); gameDevTitle.x = 2048 / 2; gameDevTitle.y = 700; currentMenu.addChild(gameDevTitle); // Lead developer var leadDeveloperText = new Text2('👨💻 Ana Geliştirici: Şafak\n\n🔧 Oyun Motoru: FRVR LK Engine\n💻 Programlama: JavaScript\n🎨 Grafik Tasarım: Dijital Sanat', { size: 50, fill: 0xFFFFFF }); leadDeveloperText.anchor.set(0.5, 0.5); leadDeveloperText.x = 2048 / 2; leadDeveloperText.y = 950; currentMenu.addChild(leadDeveloperText); // Special thanks section var thanksTitle = new Text2('🙏 TEŞEKKÜRLER', { size: 60, fill: 0x27ae60 }); thanksTitle.anchor.set(0.5, 0.5); thanksTitle.x = 2048 / 2; thanksTitle.y = 1200; currentMenu.addChild(thanksTitle); var thanksText = new Text2('• FRVR oyun platformu ve geliştirme araçları\n• Oyuncularımızın değerli geri bildirimleri\n• Beta test sürecindeki katkıları\n• Müzik ve ses efektleri için açık kaynak topluluk', { size: 45, fill: 0xecf0f1 }); thanksText.anchor.set(0.5, 0.5); thanksText.x = 2048 / 2; thanksText.y = 1400; currentMenu.addChild(thanksText); // Game info section var gameInfoTitle = new Text2('ℹ️ OYUN BİLGİLERİ', { size: 60, fill: 0x3498db }); gameInfoTitle.anchor.set(0.5, 0.5); gameInfoTitle.x = 2048 / 2; gameInfoTitle.y = 1600; currentMenu.addChild(gameInfoTitle); var gameInfoText = new Text2('📅 Geliştirme Başlangıcı: 2024\n🎮 Platform: FRVR\n📱 Desteklenen Cihazlar: Mobil & Masaüstü\n🌍 Dil Desteği: Türkçe', { size: 45, fill: 0xbdc3c7 }); gameInfoText.anchor.set(0.5, 0.5); gameInfoText.x = 2048 / 2; gameInfoText.y = 1780; currentMenu.addChild(gameInfoText); // Contact section var contactTitle = new Text2('📞 İLETİŞİM', { size: 60, fill: 0xe67e22 }); contactTitle.anchor.set(0.5, 0.5); contactTitle.x = 2048 / 2; contactTitle.y = 1980; currentMenu.addChild(contactTitle); var contactText = new Text2('Geri bildirimleriniz ve önerileriniz için:\n🎮 FRVR platform üzerinden mesaj gönderebilirsiniz', { size: 45, fill: 0x95a5a6 }); contactText.anchor.set(0.5, 0.5); contactText.x = 2048 / 2; contactText.y = 2100; currentMenu.addChild(contactText); // Back button var backButton = new MenuButton('🔙 ANA MENÜYE DÖN', 0x95a5a6); backButton.x = 2048 / 2; backButton.y = 2300; backButton.onClick = function () { LK.getSound('Click').play(); // Stop Creators music and restore background music if enabled LK.stopMusic(); if (musicEnabled) { LK.playMusic('Background'); } createMainMenu(); }; currentMenu.addChild(backButton); } // Initialize main menu createMainMenu(); // Spawn falling shapes function spawnShape() { var randomColor = colors[Math.floor(Math.random() * colors.length)]; var shape = new FallingShape(randomColor); shape.x = Math.random() * (2048 - 160) + 80; shape.y = -80; // Apply difficulty and speed settings to shape speed var baseFallSpeed = difficultyLevel === 'Easy' ? 2 : difficultyLevel === 'Hard' ? 4 : 3; var speedMultiplier = gameSpeedSetting === 'Slow' ? 0.7 : gameSpeedSetting === 'Fast' ? 1.3 : 1.0; shape.speed = baseFallSpeed * speedMultiplier + gameSpeed * 0.5; // Apply slow motion effect if active if (slowMotionActive) { shape.speed *= 0.5; } // Add beautiful entrance animation based on quality settings var animationQuality = storage.animationQuality || 'High'; if (animationQuality !== 'Low') { // Start with small scale and fade in shape.scaleX = 0.1; shape.scaleY = 0.1; shape.alpha = 0; // Animate scale with bounce effect var animDuration = animationQuality === 'Medium' ? 200 : 300; tween(shape, { scaleX: 1.2, scaleY: 1.2, alpha: 1 }, { duration: animDuration, easing: tween.bounceOut, onFinish: function onFinish() { tween(shape, { scaleX: 1, scaleY: 1 }, { duration: animDuration * 0.67, easing: tween.easeOut }); } }); // Add subtle rotation animation only on high quality if (animationQuality === 'High') { tween(shape, { rotation: Math.PI * 0.1 }, { duration: 600, easing: tween.easeInOut, onFinish: function onFinish() { tween(shape, { rotation: -Math.PI * 0.1 }, { duration: 600, easing: tween.easeInOut, onFinish: function onFinish() { // Continue subtle rotation loop if (shape.parent) { tween(shape, { rotation: 0 }, { duration: 400, easing: tween.easeInOut }); } } }); } }); } } fallingShapes.push(shape); game.addChild(shape); } // Handle touch/mouse events function handleMove(x, y, obj) { if (gameState === 'playing' && draggedBasket) { draggedBasket.x = Math.max(100, Math.min(1948, x)); } } game.move = handleMove; game.down = function (x, y, obj) { // Only handle basket dragging during gameplay if (gameState !== 'playing') { return; } // Check if touch is on any basket for (var i = 0; i < baskets.length; i++) { var basket = baskets[i]; var dx = x - basket.x; var dy = y - basket.y; if (Math.abs(dx) < 100 && Math.abs(dy) < 60) { draggedBasket = basket; break; } } }; game.up = function (x, y, obj) { draggedBasket = null; }; // Main game loop var shapeSpawnTimer = 0; var difficultyTimer = 0; game.update = function () { // Update background particles (always running) var particleEffectsEnabled = storage.particleEffectsEnabled !== undefined ? storage.particleEffectsEnabled : true; if (particleEffectsEnabled) { particleSpawnTimer++; var spawnRate = storage.animationQuality === 'Low' ? 40 : storage.animationQuality === 'Medium' ? 30 : 20; if (particleSpawnTimer >= spawnRate) { // Spawn particle every spawnRate frames var particle = new BackgroundParticle(); particle.x = Math.random() * 2048; particle.y = 2732 + 50; // Start below screen backgroundParticles.push(particle); backgroundContainer.addChild(particle); particleSpawnTimer = 0; } } // Update and clean up particles for (var p = backgroundParticles.length - 1; p >= 0; p--) { var particle = backgroundParticles[p]; if (particle.shouldRemove) { particle.destroy(); backgroundParticles.splice(p, 1); } } // Only run game logic when actually playing and not paused if (gameState !== 'playing' || gamePaused) { return; } // Update power-up timers if (slowMotionActive) { slowMotionTimer--; if (slowMotionTimer <= 0) { slowMotionActive = false; updateBallDisplay(); } } if (doublePointsActive) { doublePointsTimer--; if (doublePointsTimer <= 0) { doublePointsActive = false; updateBallDisplay(); } } // Spawn power-ups occasionally powerUpSpawnTimer++; if (powerUpSpawnTimer >= 900) { // Every 15 seconds if (Math.random() < 0.7) { // 70% chance to spawn var powerUpType = Math.random() < 0.5 ? 'slowMotion' : 'doublePoints'; var powerUp = new PowerUp(powerUpType); powerUp.x = Math.random() * (2048 - 120) + 60; powerUp.y = -60; powerUps.push(powerUp); game.addChild(powerUp); } powerUpSpawnTimer = 0; } // Update power-ups for (var p = powerUps.length - 1; p >= 0; p--) { var powerUp = powerUps[p]; // Check if power-up went off screen if (powerUp.lastY < 2732 && powerUp.y >= 2732) { powerUp.destroy(); powerUps.splice(p, 1); continue; } // Check collision with baskets for (var j = 0; j < baskets.length; j++) { var basket = baskets[j]; if (powerUp.intersects(basket)) { // Activate power-up LK.getSound('powerup').play(); if (powerUp.type === 'slowMotion') { slowMotionActive = true; slowMotionTimer = 600; // 10 seconds } else if (powerUp.type === 'doublePoints') { doublePointsActive = true; doublePointsTimer = 600; // 10 seconds } updateBallDisplay(); // Visual effect LK.effects.flashScreen(powerUp.type === 'slowMotion' ? 0x3498db : 0xf1c40f, 300); powerUp.destroy(); powerUps.splice(p, 1); break; } } } // Spawn shapes shapeSpawnTimer++; // Calculate spawn interval based on difficulty and slow motion var baseInterval = difficultyLevel === 'Easy' ? 150 : difficultyLevel === 'Hard' ? 90 : 120; var spawnInterval = Math.max(30, baseInterval - gameSpeed * 10); if (slowMotionActive) { spawnInterval *= 1.5; // Slow down spawning during slow motion } if (shapeSpawnTimer >= spawnInterval) { spawnShape(); shapeSpawnTimer = 0; } // Update difficulty difficultyTimer++; if (difficultyTimer >= 600) { // Every 10 seconds gameSpeed += 0.2; difficultyTimer = 0; } // Update falling shapes for (var i = fallingShapes.length - 1; i >= 0; i--) { var shape = fallingShapes[i]; // Check if shape went off screen if (shape.lastY < 2732 && shape.y >= 2732) { // Shape missed - game over // Save final game time if (sessionStartTime > 0) { var sessionTime = Math.floor((Date.now() - sessionStartTime) / 1000); totalGameTime = (storage.totalGameTime || 0) + sessionTime; storage.totalGameTime = totalGameTime; sessionStartTime = 0; // Reset session start time } // Save high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; } LK.getSound('miss').play(); var screenEffectsEnabled = storage.screenEffectsEnabled !== undefined ? storage.screenEffectsEnabled : true; if (screenEffectsEnabled) { LK.effects.flashScreen(0xff0000, 500); } LK.showGameOver(); return; } // Check collision with baskets var caught = false; for (var j = 0; j < baskets.length; j++) { var basket = baskets[j]; if (shape.intersects(basket)) { if (shape.color === basket.color) { // Correct match consecutiveMatches++; var points = 10 + consecutiveMatches * 2; // Apply double points if active if (doublePointsActive) { points *= 2; } LK.setScore(LK.getScore() + points); scoreTxt.setText(LK.getScore()); // Update ball collection count ballsCollected[shape.color]++; storage[shape.color + 'BallsCollected'] = ballsCollected[shape.color]; updateBallDisplay(); // Check if all requirements are met if (ballsCollected.red >= ballRequirements.red && ballsCollected.blue >= ballRequirements.blue && ballsCollected.yellow >= ballRequirements.yellow) { // If this is level 2 (final level), show you win if (currentLevel === 2) { // Save final game time if (sessionStartTime > 0) { var sessionTime = Math.floor((Date.now() - sessionStartTime) / 1000); totalGameTime = (storage.totalGameTime || 0) + sessionTime; storage.totalGameTime = totalGameTime; sessionStartTime = 0; } // Save high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; } LK.showYouWin(); } else { showLevelComplete(); } return; } LK.getSound('catch').play(); LK.getSound('basketball').play(); // Visual feedback tween(basket, { scaleX: 1.2, scaleY: 1.2 }, { duration: 200, onFinish: function onFinish() { tween(basket, { scaleX: 1, scaleY: 1 }, { duration: 200 }); } }); } else { // Wrong color - game over consecutiveMatches = 0; // Save final game time if (sessionStartTime > 0) { var sessionTime = Math.floor((Date.now() - sessionStartTime) / 1000); totalGameTime = (storage.totalGameTime || 0) + sessionTime; storage.totalGameTime = totalGameTime; sessionStartTime = 0; // Reset session start time } // Save high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; } LK.getSound('miss').play(); var screenEffectsEnabled = storage.screenEffectsEnabled !== undefined ? storage.screenEffectsEnabled : true; if (screenEffectsEnabled) { LK.effects.flashScreen(0xff0000, 500); } LK.showGameOver(); return; } shape.destroy(); fallingShapes.splice(i, 1); caught = true; break; } } // Remove shapes that went too far down without being caught if (!caught && shape.y > 2800) { shape.destroy(); fallingShapes.splice(i, 1); } } }; function showLevelComplete() { gameState = 'levelcomplete'; // Save final game time if (sessionStartTime > 0) { var sessionTime = Math.floor((Date.now() - sessionStartTime) / 1000); totalGameTime = (storage.totalGameTime || 0) + sessionTime; storage.totalGameTime = totalGameTime; sessionStartTime = 0; } // Save high score if current score is higher if (LK.getScore() > highScore) { highScore = LK.getScore(); storage.highScore = highScore; } // Save current level progress currentLevel++; storage.currentLevel = currentLevel; levelCompleted = true; // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Level complete title with animation var completeTitle = new Text2('BÖLÜM ' + (currentLevel - 1) + ' TAMAMLANDI!', { size: 90, fill: 0x27ae60 }); completeTitle.anchor.set(0.5, 0.5); completeTitle.x = 2048 / 2; completeTitle.y = 600; currentMenu.addChild(completeTitle); // Animate title with celebration effect tween(completeTitle, { scaleX: 1.2, scaleY: 1.2, tint: 0xf1c40f }, { duration: 500, easing: tween.bounceOut, onFinish: function onFinish() { tween(completeTitle, { scaleX: 1, scaleY: 1, tint: 0x27ae60 }, { duration: 300, easing: tween.easeOut }); } }); // Score section var scoreTitle = new Text2('KAZANDIĞINIZ PUAN', { size: 60, fill: 0xf1c40f }); scoreTitle.anchor.set(0.5, 0.5); scoreTitle.x = 2048 / 2; scoreTitle.y = 900; currentMenu.addChild(scoreTitle); var scoreValue = new Text2(LK.getScore().toString(), { size: 100, fill: 0xFFFFFF }); scoreValue.anchor.set(0.5, 0.5); scoreValue.x = 2048 / 2; scoreValue.y = 1020; currentMenu.addChild(scoreValue); // Next level preview var nextLevelTitle = new Text2('BÖLÜM ' + currentLevel + ' HAZIR!', { size: 70, fill: 0x3498db }); nextLevelTitle.anchor.set(0.5, 0.5); nextLevelTitle.x = 2048 / 2; nextLevelTitle.y = 1250; currentMenu.addChild(nextLevelTitle); var nextLevelDesc = new Text2('Yeni bölümde daha hızlı şekiller\nve daha zorlu hedefler sizi bekliyor!', { size: 50, fill: 0xecf0f1 }); nextLevelDesc.anchor.set(0.5, 0.5); nextLevelDesc.x = 2048 / 2; nextLevelDesc.y = 1400; currentMenu.addChild(nextLevelDesc); // Progress celebration var progressText = new Text2('🎉 TEBRİKLER! 🎉\nYeni seviyeye ulaştınız!', { size: 55, fill: 0xff6b6b }); progressText.anchor.set(0.5, 0.5); progressText.x = 2048 / 2; progressText.y = 1600; currentMenu.addChild(progressText); // Buttons var nextLevelButton = new MenuButton('BÖLÜM ' + currentLevel + '\'E GEÇE', 0x27ae60); nextLevelButton.x = 2048 / 2; nextLevelButton.y = 1850; nextLevelButton.onClick = function () { LK.getSound('Click').play(); startNextLevel(); }; currentMenu.addChild(nextLevelButton); var menuButton = new MenuButton('ANA MENÜYE DÖN', 0x34495e); menuButton.x = 2048 / 2; menuButton.y = 2050; menuButton.onClick = function () { LK.getSound('Click').play(); createMainMenu(); }; currentMenu.addChild(menuButton); // Play celebration sound LK.getSound('Applause').play(); } function startNextLevel() { // Reset ball collection for new level ballsCollected.red = 0; ballsCollected.blue = 0; ballsCollected.yellow = 0; storage.redBallsCollected = 0; storage.blueBallsCollected = 0; storage.yellowBallsCollected = 0; // Set requirements based on level - level 2 is final level with 10 balls each if (currentLevel === 2) { ballRequirements.red = 10; ballRequirements.blue = 10; ballRequirements.yellow = 10; } else { ballRequirements.red = 5 + currentLevel; ballRequirements.blue = 5 + currentLevel; ballRequirements.yellow = 5 + currentLevel; } levelCompleted = false; startGame(); } function showRecentUpdates() { gameState = 'recentupdates'; // Clear existing menu if (currentMenu) { currentMenu.destroy(); } currentMenu = new Container(); game.addChild(currentMenu); // Title var updatesTitle = new Text2('🆕 OYUNA SON EKLENENLER', { size: 80, fill: 0x1abc9c }); updatesTitle.anchor.set(0.5, 0.5); updatesTitle.x = 2048 / 2; updatesTitle.y = 400; currentMenu.addChild(updatesTitle); // Version section var versionTitle = new Text2('📋 GÜNCEL VERSİYON: v1.2', { size: 60, fill: 0xf1c40f }); versionTitle.anchor.set(0.5, 0.5); versionTitle.x = 2048 / 2; versionTitle.y = 600; currentMenu.addChild(versionTitle); // Recent updates section var recentTitle = new Text2('⭐ YENİ ÖZELLİKLER', { size: 60, fill: 0x3498db }); recentTitle.anchor.set(0.5, 0.5); recentTitle.x = 2048 / 2; recentTitle.y = 800; currentMenu.addChild(recentTitle); var recentText = new Text2('• Bölüm sistemi eklendi (2 bölüm)\n• İstatistiklerim menüsü eklendi\n• Toplam oyun süresi takibi\n• Başarım sistemi geliştirildi\n• Ayarlar menüsü genişletildi\n• Ses efektleri iyileştirildi', { size: 45, fill: 0xFFFFFF }); recentText.anchor.set(0.5, 0.5); recentText.x = 2048 / 2; recentText.y = 980; currentMenu.addChild(recentText); // Improvements section var improvementsTitle = new Text2('🔧 İYİLEŞTİRMELER', { size: 60, fill: 0x27ae60 }); improvementsTitle.anchor.set(0.5, 0.5); improvementsTitle.x = 2048 / 2; improvementsTitle.y = 1200; currentMenu.addChild(improvementsTitle); var improvementsText = new Text2('• Oyun performansı optimize edildi\n• Menü geçişleri daha akıcı hale getirildi\n• Renk körü modu için hazırlık yapıldı\n• Dokunmatik kontroller iyileştirildi\n• Arka plan animasyonları güncellendi', { size: 45, fill: 0xecf0f1 }); improvementsText.anchor.set(0.5, 0.5); improvementsText.x = 2048 / 2; improvementsText.y = 1380; currentMenu.addChild(improvementsText); // Coming soon section var comingSoonTitle = new Text2('🚀 YAKINDA GELECEKLER', { size: 60, fill: 0xe67e22 }); comingSoonTitle.anchor.set(0.5, 0.5); comingSoonTitle.x = 2048 / 2; comingSoonTitle.y = 1600; currentMenu.addChild(comingSoonTitle); var comingSoonText = new Text2('• Günlük meydan okumalar\n• Farklı oyun modları\n• Liderlik tablosu\n• Sosyal paylaşım özellikleri\n• Yeni şekil türleri', { size: 45, fill: 0xbdc3c7 }); comingSoonText.anchor.set(0.5, 0.5); comingSoonText.x = 2048 / 2; comingSoonText.y = 1780; currentMenu.addChild(comingSoonText); // Bug fixes section var bugFixesTitle = new Text2('🐛 HATA DÜZELTMELERİ', { size: 60, fill: 0x9b59b6 }); bugFixesTitle.anchor.set(0.5, 0.5); bugFixesTitle.x = 2048 / 2; bugFixesTitle.y = 2000; currentMenu.addChild(bugFixesTitle); var bugFixesText = new Text2('• Oyun süresi hesaplama hatası düzeltildi\n• Sepet sürükleme hassasiyeti artırıldı\n• Menü butonları daha responsive\n• Müzik ayarları kaydetme sorunu çözüldü', { size: 45, fill: 0x95a5a6 }); bugFixesText.anchor.set(0.5, 0.5); bugFixesText.x = 2048 / 2; bugFixesText.y = 2140; currentMenu.addChild(bugFixesText); // Feature requests section var requestTitle = new Text2('💡 OYUNA GELMESİNİ İSTEDİKLERİNİZ', { size: 60, fill: 0xff6b6b }); requestTitle.anchor.set(0.5, 0.5); requestTitle.x = 2048 / 2; requestTitle.y = 2320; currentMenu.addChild(requestTitle); var requestText = new Text2('• Power-up özellikler (Slow Motion, Extra Points)\n• Farklı şekil türleri (Yıldız, Kalp, Üçgen)\n• Sezonluk temalar (Kış, Yaz, Bahar)\n• Çok oyunculu mod\n• Günlük görevler ve ödüller\n• Özelleştirilebilir sepet tasarımları', { size: 45, fill: 0xFFFFFF }); requestText.anchor.set(0.5, 0.5); requestText.x = 2048 / 2; requestText.y = 2500; currentMenu.addChild(requestText); // Add request submission info var submitInfo = new Text2('Sizin de eklemek istediğiniz özellikler var mı?\nFRVR platform üzerinden bize yazabilirsiniz!', { size: 40, fill: 0xbdc3c7 }); submitInfo.anchor.set(0.5, 0.5); submitInfo.x = 2048 / 2; submitInfo.y = 2730; currentMenu.addChild(submitInfo); // Back button var backButton = new MenuButton('⬅ ANA MENÜYE DÖN', 0x34495e); backButton.x = 350; // Position on left side instead of center backButton.y = 1366; // Middle of screen height (2732/2) // Add subtle animation to the back button tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { tween(backButton, { alpha: 1 }, { duration: 1500, easing: tween.easeInOut, onFinish: function onFinish() { // Repeat animation if (gameState === 'recentupdates') { tween(backButton, { alpha: 0.8 }, { duration: 1500, easing: tween.easeInOut }); } } }); } }); backButton.onClick = function () { LK.getSound('Click').play(); // Add visual feedback on click tween(backButton.bg, { tint: 0x2c3e50 }, { duration: 100, onFinish: function onFinish() { tween(backButton.bg, { tint: 0x34495e }, { duration: 100 }); } }); createMainMenu(); }; currentMenu.addChild(backButton); }
===================================================================
--- original.js
+++ change.js
@@ -1436,15 +1436,115 @@
}
}
}
function startGame() {
- gameState = 'playing';
+ gameState = 'countdown';
gamePaused = false;
// Clear menu
if (currentMenu) {
currentMenu.destroy();
currentMenu = null;
}
+ // Start countdown sequence
+ startCountdown();
+}
+function startCountdown() {
+ // Create countdown container
+ var countdownContainer = new Container();
+ game.addChild(countdownContainer);
+ // Create semi-transparent overlay
+ var overlay = LK.getAsset('shape', {
+ width: 2048,
+ height: 2732,
+ color: 0x000000,
+ shape: 'box',
+ anchorX: 0,
+ anchorY: 0
+ });
+ overlay.alpha = 0.7;
+ countdownContainer.addChild(overlay);
+ // Countdown numbers
+ var countdownNumbers = ['3', '2', '1', 'BAŞLA!'];
+ var currentIndex = 0;
+ function showNextNumber() {
+ if (currentIndex >= countdownNumbers.length) {
+ // Countdown finished, start actual game
+ countdownContainer.destroy();
+ actuallyStartGame();
+ return;
+ }
+ // Create countdown text
+ var countdownText = new Text2(countdownNumbers[currentIndex], {
+ size: currentIndex === 3 ? 100 : 200,
+ fill: currentIndex === 3 ? 0x27ae60 : 0xf1c40f
+ });
+ countdownText.anchor.set(0.5, 0.5);
+ countdownText.x = 2048 / 2;
+ countdownText.y = 2732 / 2;
+ countdownContainer.addChild(countdownText);
+ // Initial animation - start big and fade in
+ countdownText.scaleX = 3;
+ countdownText.scaleY = 3;
+ countdownText.alpha = 0;
+ // Play countdown sound
+ LK.getSound('Click').play();
+ // Animate the number
+ tween(countdownText, {
+ scaleX: 1,
+ scaleY: 1,
+ alpha: 1
+ }, {
+ duration: 300,
+ easing: tween.bounceOut,
+ onFinish: function onFinish() {
+ // Hold for a moment then shrink and fade out
+ LK.setTimeout(function () {
+ tween(countdownText, {
+ scaleX: 0.5,
+ scaleY: 0.5,
+ alpha: 0,
+ rotation: Math.PI * 0.1
+ }, {
+ duration: 200,
+ easing: tween.easeIn,
+ onFinish: function onFinish() {
+ countdownText.destroy();
+ currentIndex++;
+ showNextNumber();
+ }
+ });
+ }, currentIndex === 3 ? 500 : 700); // Hold "BAŞLA!" longer
+ }
+ });
+ // Add pulsing glow effect
+ function pulseGlow() {
+ if (countdownText.parent) {
+ tween(countdownText, {
+ tint: 0xffffff
+ }, {
+ duration: 200,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ if (countdownText.parent) {
+ tween(countdownText, {
+ tint: currentIndex === 3 ? 0x27ae60 : 0xf1c40f
+ }, {
+ duration: 200,
+ easing: tween.easeInOut
+ });
+ }
+ }
+ });
+ }
+ }
+ // Start glow effect after initial animation
+ LK.setTimeout(pulseGlow, 350);
+ }
+ // Start the countdown
+ showNextNumber();
+}
+function actuallyStartGame() {
+ gameState = 'playing';
// Show score and ball collection display
scoreTxt.visible = true;
ballCountTxt.visible = true;
pauseButton.visible = true;
Make me a 2d basketball hoop net in yellow color. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap sarı renkli olsun. In-Game asset. 2d. High contrast. No shadows
Make me a 2d basketball hoop net in blue color. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap mavi renk olsun. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topu yap kırmızı renk olsun. In-Game asset. 2d. High contrast. No shadows
Make me a 2d basketball hoop net in red color. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
600x120 size box, Oyunu başlat text yazısı. In-Game asset. 2d. High contrast. No shadows
Bana 2d basketbol topuyap gökkuşağı renklerinde olsun. In-Game asset. 2d. High contrast. No shadows