User prompt
kod sıkıntı var düzelt
User prompt
olmadı oyun bittmedi düzelt şunu
User prompt
1000000 dolar oldunda oyun bitsin şöyle yazı cıksın mega zengi oldunuz dünyları bile alabilirsiniz oynadınız için teşekürler ve restart tuşu gelsin bunu hem ingilizceye hem türkçeye çevir
User prompt
ınfo bölümü güncele
User prompt
başarımı adı sömürgeci olsun
User prompt
Başarımlarda markete her şeyi aldımızda sömürge başarısını alsın
User prompt
markete işciler bize gelen pasif parayı 5 katına çıkarsın
User prompt
markete işçiler olsun bunu aldımızda 5x boost alalım fiyatıh 50000 dolar
User prompt
ınfo da bazı şeylen okuyamıyrum yukarı aşağı gitmemiz için bişey olsun
User prompt
ınfo güncele
User prompt
havalimanı 10 saniyede 4000 dolar kazanalım
User prompt
havalimanı 10 saniyede 10000 dolar kazanalım
User prompt
1000000 para oldun oyun bitsin ve önüne yazı gelsin ve şunlar yazsın- artık mega zengin oldun dünyayı bile alabilirsin oynadınız için teşekürler - iki seçenek olsun restart ve oyunda çıkma tuşu olsun oyunda ingilizce dil cevirmiş olanlara ingilizce gelsin türkçe diline çevirmiş olanlara türkçe olsun
User prompt
markete havalimanı olsun fiyatı 100000 dolar 10 saniyede 1000 dolar versin
User prompt
markerten apartman olsun 10 saniyede 300 dolar versin fiyattı 15000 dolar olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
dil çevirmede türkçeye çevirdimde sıkıntı gördüm play,ınfo,language,music settıngs türkçe olmadı
User prompt
ingilizce yaptımda oynat,bilgi,dil,müzik ayarları ingilizce değil luften düzelt
User prompt
türkçe yaptımda play,ınfo,language,music settıngs türkçe değil lüften düzelt
User prompt
ınfo bölümünü güncele
User prompt
müzik ayaranın müzik sesini artırıp azaltmak icin eksi veya artıya basalım
User prompt
müzik sesini azaltma ve artırma olsun
User prompt
müzik ayarı language bir altında olsun içinde değil
User prompt
language bir tık altına müzik ayarları olsun ses ayralayalım mesala
User prompt
olmadı
User prompt
arkada eylen müziği de çalsın
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Achievement = Container.expand(function (achievementData) { var self = Container.call(this); self.id = achievementData.id; self.name = achievementData.name; self.description = achievementData.description; self.unlocked = achievementData.unlocked || false; // Create achievement item background var itemBg = LK.getAsset('itemBg', { width: 550, height: 150, color: self.unlocked ? 0x4CAF50 : 0x3c3c5c, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); self.addChild(itemBg); // Create achievement name text var nameText = new Text2(self.name, { size: 60, fill: self.unlocked ? 0xFFFFFF : 0x888888 }); nameText.anchor.set(0.5, 0); nameText.y = -40; self.addChild(nameText); // Create achievement description text var descText = new Text2(self.description, { size: 40, fill: self.unlocked ? 0xCCCCCC : 0x666666 }); descText.anchor.set(0.5, 0); descText.y = -5; self.addChild(descText); // Create status text var statusText = new Text2(self.unlocked ? 'UNLOCKED' : 'LOCKED', { size: 50, fill: self.unlocked ? 0xFFD700 : 0x888888 }); statusText.anchor.set(0.5, 0); statusText.y = 30; self.addChild(statusText); self.unlock = function () { if (!self.unlocked) { self.unlocked = true; itemBg.tint = 0x4CAF50; nameText.style.fill = 0xFFFFFF; descText.style.fill = 0xCCCCCC; statusText.setText('UNLOCKED'); statusText.style.fill = 0xFFD700; // Flash effect LK.effects.flashObject(self, 0xFFD700, 500); } }; return self; }); var AchievementPanel = Container.expand(function () { var self = Container.call(this); // Create achievement panel background var achievementBg = LK.getAsset('shopBackground', { width: 600, height: 2732, color: 0x2c2c54, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(achievementBg); // Create title var titleText = new Text2('ACHIEVEMENTS', { size: 80, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0); titleText.x = 300; titleText.y = 50; self.addChild(titleText); // Create achievement items self.achievementItems = []; self.updateAchievements = function () { // Clear existing items for (var i = 0; i < self.achievementItems.length; i++) { self.removeChild(self.achievementItems[i]); } self.achievementItems = []; // Add current achievements for (var i = 0; i < achievementsData.length; i++) { var achievement = new Achievement(achievementsData[i]); achievement.x = 300; achievement.y = 200 + i * 180; self.achievementItems.push(achievement); self.addChild(achievement); } }; return self; }); var BackgroundParticle = Container.expand(function () { var self = Container.call(this); var particleGraphics = self.attachAsset('backgroundParticle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = Math.random() * 2 + 1; self.alpha = Math.random() * 0.5 + 0.2; self.update = function () { self.y += self.speed; if (self.y > 2732 + 50) { self.y = -50; self.x = Math.random() * 2048; } }; return self; }); var BottomMenu = Container.expand(function () { var self = Container.call(this); // Create bottom menu background var menuBg = LK.getAsset('bottomMenuBackground', { width: 2048, height: 300, color: 0x2c2c54, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(menuBg); // Create exit button var exitButton = LK.getAsset('exitButton', { width: 300, height: 80, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); exitButton.x = 512; exitButton.y = 150; self.addChild(exitButton); self.exitButtonText = new Text2(translations[currentLanguage].exit, { size: 50, fill: 0xFFFFFF }); self.exitButtonText.anchor.set(0.5, 0.5); self.exitButtonText.x = 512; self.exitButtonText.y = 150; self.addChild(self.exitButtonText); // Create restart button var restartButton = LK.getAsset('restartButton', { width: 300, height: 80, color: 0x4caf50, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); restartButton.x = 1536; restartButton.y = 150; self.addChild(restartButton); self.restartButtonText = new Text2(translations[currentLanguage].restart, { size: 50, fill: 0xFFFFFF }); self.restartButtonText.anchor.set(0.5, 0.5); self.restartButtonText.x = 1536; self.restartButtonText.y = 150; self.addChild(self.restartButtonText); // Exit button click handler exitButton.down = function (x, y, obj) { // Hide bottom menu self.visible = false; bottomMenuOpen = false; // Show main menu mainMenu.visible = true; gameStarted = false; // Hide game UI coinCountText.visible = false; tapCountText.visible = false; coinsPerTapText.visible = false; shopButton.visible = false; menuButton.visible = false; achievementsButton.visible = false; // Disable game interactions game.interactive = false; game.buttonMode = false; // Close shop if open if (shopOpen) { shopOpen = false; tween(shopPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } }; // Restart button click handler restartButton.down = function (x, y, obj) { // Reset game state totalCoins = 0; tapCount = 0; coinsPerTap = 1; gameStarted = false; // Clear storage storage.totalCoins = 0; storage.tapCount = 0; storage.autoClicker = false; storage.boostUpgrade = false; storage.bakery = false; storage.factory = false; storage.farm = false; storage.bank = false; storage.company = false; storage.apartment = false; storage.airport = false; storage.workers = false; storage.achievement_somurge = false; // Reset shop items for (var i = 0; i < shopItemsData.length; i++) { shopItemsData[i].owned = false; } // Update UI texts coinCountText.setText('$' + totalCoins); tapCountText.setText('Taps: ' + tapCount); coinsPerTapText.setText('$' + coinsPerTap + ' per tap'); // Hide bottom menu self.visible = false; bottomMenuOpen = false; // Show main menu mainMenu.visible = true; gameStarted = false; // Hide game UI coinCountText.visible = false; tapCountText.visible = false; coinsPerTapText.visible = false; shopButton.visible = false; menuButton.visible = false; achievementsButton.visible = false; // Disable game interactions game.interactive = false; game.buttonMode = false; // Close shop if open if (shopOpen) { shopOpen = false; tween(shopPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } }; return self; }); var Coin = Container.expand(function () { var self = Container.call(this); var coinGraphics = self.attachAsset('coin', { anchorX: 0.5, anchorY: 0.5 }); self.startAnimation = function (startX, startY, targetX, targetY) { self.x = startX; self.y = startY; self.alpha = 1; self.scale.set(0.5); // Scale up animation tween(self.scale, { x: 1, y: 1 }, { duration: 200, easing: tween.easeOut }); // Move to target position tween(self, { x: targetX, y: targetY }, { duration: 800, easing: tween.easeInOut, onFinish: function onFinish() { self.destroy(); } }); // Fade out near the end LK.setTimeout(function () { tween(self, { alpha: 0 }, { duration: 200 }); }, 600); }; return self; }); var GoldenDollar = Container.expand(function () { var self = Container.call(this); var dollarGraphics = self.attachAsset('goldDollar', { anchorX: 0.5, anchorY: 0.5 }); dollarGraphics.tint = 0xFFD700; // Golden color self.speed = 1; // Slow falling speed self.collected = false; self.update = function () { if (!self.collected) { self.y += self.speed; // Remove if off screen if (self.y > 2732 + 50) { self.destroy(); } } }; self.down = function (x, y, obj) { if (!self.collected) { self.collected = true; totalCoins += 50; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; // Flash effect LK.effects.flashObject(self, 0xFFD700, 300); // Scale up and fade out animation tween(self.scale, { x: 1.5, y: 1.5 }, { duration: 300, easing: tween.easeOut }); tween(self, { alpha: 0 }, { duration: 300, onFinish: function onFinish() { self.destroy(); } }); // Play coin sound LK.getSound('coinSound').play(); // Check golden hunter achievement if (!storage.achievement_golden_hunter) { storage.achievement_golden_hunter = true; achievementsData[3].unlocked = true; achievementPanel.updateAchievements(); } } }; return self; }); var InfoPanel = Container.expand(function () { var self = Container.call(this); // Create info panel background var infoBg = LK.getAsset('menuBackground', { width: 2048, height: 2732, color: 0x1a1a2e, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(infoBg); // Create scrollable content container var contentContainer = new Container(); self.addChild(contentContainer); // Scroll offset var scrollOffset = 0; var maxScrollOffset = 0; var scrollSpeed = 100; // Create title var titleText = new Text2('HOW TO PLAY', { size: 120, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 400; contentContainer.addChild(titleText); // Create instructions text var instructions = ['TAP THE SCREEN TO EARN COINS', '', 'SHOP ITEMS:', '• Auto Clicker ($500) - Earn coins automatically every 2 seconds', '• 2X Boost ($120) - Double your coins per tap permanently', '• Bakery ($500) - Earn $10 every second passively', '• Factory ($2000) - Earn $120 every 30 seconds', '• Farm ($1000) - Earn $20 every 5 seconds', '• Bank ($5000) - Earn $200 every 10 seconds', '• Company ($30000) - Earn $400 every 5 seconds', '• Apartment ($15000) - Earn $300 every 10 seconds', '• Airport ($100000) - Earn $4000 every 10 seconds', '• Workers ($50000) - 5x boost to ALL income sources!', '', 'GOLDEN DOLLARS:', '• Rarely fall from the sky (5% chance every 3 seconds)', '• Tap them to earn $50 instantly', '• Unlocks Golden Hunter achievement', '', 'ACHIEVEMENTS (9 TOTAL):', '• The Beginning - Make your first tap', '• Coin Collector - Collect $100', '• Tap Master - Tap 50 times', '• Golden Hunter - Catch a golden dollar', '• Shop Keeper - Buy your first shop item', '• Money - Collect $1000', '• Rich - Collect $100000', '• Millionaire - Collect $1000000', '• Colonist - Buy ALL shop items', '', 'GAME FEATURES:', '• Beautiful particle effects and animations', '• Coin collection animations fly to score display', '• Visual feedback for all interactions', '• Persistent progress saving', '• Dynamic difficulty scaling', '', 'WIN CONDITION:', '• Collect 1,000,000 coins to become mega rich!', '• Special victory screen with restart options', '• Challenge: Can you unlock all achievements?', '', 'MUSIC & SOUND:', '• Background music switches every 30 seconds', '• Coin collection sound effects', '• Tap sound feedback', '• Volume controls and mute options', '', 'LANGUAGE SUPPORT:', '• Turkish and English language options', '• All UI elements translate automatically', '• Switch languages anytime from main menu', '', 'STRATEGY TIPS:', '• Workers boost is the most powerful upgrade!', '• Golden dollars are worth 50 regular taps', '• Passive income builds while you are away', '• Focus on expensive items for better returns', '', 'BUILD YOUR FORTUNE AND BECOME MEGA RICH!']; var startY = 650; var instructionTexts = []; for (var i = 0; i < instructions.length; i++) { var instructionText = new Text2(instructions[i], { size: instructions[i] === '' ? 30 : instructions[i].startsWith('•') ? 45 : 50, fill: instructions[i].startsWith('•') ? 0x4CAF50 : instructions[i].endsWith(':') ? 0xFFD700 : 0xFFFFFF }); instructionText.anchor.set(0.5, 0.5); instructionText.x = 1024; instructionText.y = startY + i * 65; instructionTexts.push(instructionText); contentContainer.addChild(instructionText); } // Calculate max scroll offset based on content height var contentHeight = startY + instructions.length * 65 + 200; maxScrollOffset = Math.max(0, contentHeight - 1800); // Leave room for buttons // Create scroll up button var scrollUpButton = LK.getAsset('playButton', { width: 150, height: 80, color: 0x2196F3, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); scrollUpButton.x = 1024; scrollUpButton.y = 200; self.addChild(scrollUpButton); var scrollUpText = new Text2('↑', { size: 60, fill: 0xFFFFFF }); scrollUpText.anchor.set(0.5, 0.5); scrollUpText.x = 1024; scrollUpText.y = 200; self.addChild(scrollUpText); // Create scroll down button var scrollDownButton = LK.getAsset('playButton', { width: 150, height: 80, color: 0x2196F3, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); scrollDownButton.x = 1024; scrollDownButton.y = 2150; self.addChild(scrollDownButton); var scrollDownText = new Text2('↓', { size: 60, fill: 0xFFFFFF }); scrollDownText.anchor.set(0.5, 0.5); scrollDownText.x = 1024; scrollDownText.y = 2150; self.addChild(scrollDownText); // Function to update scroll position self.updateScroll = function () { contentContainer.y = -scrollOffset; // Update button visibility based on scroll position scrollUpButton.alpha = scrollOffset > 0 ? 1 : 0.3; scrollDownButton.alpha = scrollOffset < maxScrollOffset ? 1 : 0.3; scrollUpText.alpha = scrollOffset > 0 ? 1 : 0.3; scrollDownText.alpha = scrollOffset < maxScrollOffset ? 1 : 0.3; }; // Scroll up button click handler scrollUpButton.down = function (x, y, obj) { if (scrollOffset > 0) { scrollOffset = Math.max(0, scrollOffset - scrollSpeed); self.updateScroll(); tween(contentContainer, { y: -scrollOffset }, { duration: 200, easing: tween.easeOut }); } }; // Scroll down button click handler scrollDownButton.down = function (x, y, obj) { if (scrollOffset < maxScrollOffset) { scrollOffset = Math.min(maxScrollOffset, scrollOffset + scrollSpeed); self.updateScroll(); tween(contentContainer, { y: -scrollOffset }, { duration: 200, easing: tween.easeOut }); } }; // Create back button var backButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); backButton.x = 1024; backButton.y = 2500; self.addChild(backButton); var backButtonText = new Text2('BACK', { size: 80, fill: 0xFFFFFF }); backButtonText.anchor.set(0.5, 0.5); backButtonText.x = 1024; backButtonText.y = 2500; self.addChild(backButtonText); // Back button click handler backButton.down = function (x, y, obj) { // Reset scroll position when closing scrollOffset = 0; self.updateScroll(); self.visible = false; }; // Initialize scroll position self.updateScroll(); return self; }); var LanguagePanel = Container.expand(function () { var self = Container.call(this); // Create language panel background var langBg = LK.getAsset('menuBackground', { width: 2048, height: 2732, color: 0x1a1a2e, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(langBg); // Create title var titleText = new Text2('LANGUAGE / DİL', { size: 120, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 800; self.addChild(titleText); // Create Turkish button var turkishButton = LK.getAsset('playButton', { width: 500, height: 120, color: 0x4CAF50, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); turkishButton.x = 1024; turkishButton.y = 1200; self.addChild(turkishButton); var turkishButtonText = new Text2('TÜRKÇE', { size: 80, fill: 0xFFFFFF }); turkishButtonText.anchor.set(0.5, 0.5); turkishButtonText.x = 1024; turkishButtonText.y = 1200; self.addChild(turkishButtonText); // Create English button var englishButton = LK.getAsset('playButton', { width: 500, height: 120, color: 0x2196F3, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); englishButton.x = 1024; englishButton.y = 1400; self.addChild(englishButton); var englishButtonText = new Text2('ENGLISH', { size: 80, fill: 0xFFFFFF }); englishButtonText.anchor.set(0.5, 0.5); englishButtonText.x = 1024; englishButtonText.y = 1400; self.addChild(englishButtonText); // Create back button var backButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); backButton.x = 1024; backButton.y = 2300; self.addChild(backButton); var backButtonText = new Text2('BACK / GERİ', { size: 80, fill: 0xFFFFFF }); backButtonText.anchor.set(0.5, 0.5); backButtonText.x = 1024; backButtonText.y = 2300; self.addChild(backButtonText); // Turkish button click handler turkishButton.down = function (x, y, obj) { currentLanguage = 'tr'; storage.language = 'tr'; updateLanguage(); self.visible = false; }; // English button click handler englishButton.down = function (x, y, obj) { currentLanguage = 'en'; storage.language = 'en'; updateLanguage(); self.visible = false; }; // Back button click handler backButton.down = function (x, y, obj) { self.visible = false; }; return self; }); var MainMenu = Container.expand(function () { var self = Container.call(this); // Create menu background var menuBg = LK.getAsset('menuBackground', { width: 2048, height: 2732, color: 0x1a1a2e, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(menuBg); // Create title var titleText = new Text2('COIN CLICKER', { size: 150, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 800; self.addChild(titleText); // Create play button var playButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0x4CAF50, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); playButton.x = 1024; playButton.y = 1400; self.addChild(playButton); var playButtonText = new Text2('PLAY', { size: 80, fill: 0xFFFFFF }); playButtonText.anchor.set(0.5, 0.5); playButtonText.x = 1024; playButtonText.y = 1400; self.addChild(playButtonText); // Create info button var infoButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0x2196F3, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); infoButton.x = 1024; infoButton.y = 1600; self.addChild(infoButton); var infoButtonText = new Text2('INFO', { size: 80, fill: 0xFFFFFF }); infoButtonText.anchor.set(0.5, 0.5); infoButtonText.x = 1024; infoButtonText.y = 1600; self.addChild(infoButtonText); // Create language button var languageButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0xFF5722, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); languageButton.x = 1024; languageButton.y = 1800; self.addChild(languageButton); var languageButtonText = new Text2('LANGUAGE', { size: 80, fill: 0xFFFFFF }); languageButtonText.anchor.set(0.5, 0.5); languageButtonText.x = 1024; languageButtonText.y = 1800; self.addChild(languageButtonText); // Create music settings button var musicSettingsButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0x9C27B0, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); musicSettingsButton.x = 1024; musicSettingsButton.y = 2000; self.addChild(musicSettingsButton); var musicSettingsButtonText = new Text2('MUSIC SETTINGS', { size: 65, fill: 0xFFFFFF }); musicSettingsButtonText.anchor.set(0.5, 0.5); musicSettingsButtonText.x = 1024; musicSettingsButtonText.y = 2000; self.addChild(musicSettingsButtonText); // Music settings button click handler musicSettingsButton.down = function (x, y, obj) { // Show music settings panel musicSettingsPanel.visible = true; musicSettingsPanel.updateVolumeDisplay(); }; // Language button click handler languageButton.down = function (x, y, obj) { // Show language panel languagePanel.visible = true; }; // Info button click handler infoButton.down = function (x, y, obj) { // Show info panel infoPanel.visible = true; }; // Play button click handler playButton.down = function (x, y, obj) { // Hide menu and start game self.visible = false; gameStarted = true; // Enable game interactions game.interactive = true; game.buttonMode = true; // Show game UI coinCountText.visible = true; tapCountText.visible = true; coinsPerTapText.visible = true; shopButton.visible = true; menuButton.visible = true; achievementsButton.visible = true; }; return self; }); var MusicSettingsPanel = Container.expand(function () { var self = Container.call(this); // Create music settings panel background var musicBg = LK.getAsset('menuBackground', { width: 2048, height: 2732, color: 0x1a1a2e, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(musicBg); // Create title var titleText = new Text2('MUSİK AYARLARI / MUSIC SETTINGS', { size: 100, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 600; self.addChild(titleText); // Create volume control background var volumeBg = LK.getAsset('playButton', { width: 800, height: 200, color: 0x2c2c54, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); volumeBg.x = 1024; volumeBg.y = 1000; self.addChild(volumeBg); // Create volume label var volumeLabel = new Text2('SES / VOLUME', { size: 80, fill: 0xFFFFFF }); volumeLabel.anchor.set(0.5, 0.5); volumeLabel.x = 1024; volumeLabel.y = 950; self.addChild(volumeLabel); // Create volume percentage display self.volumeText = new Text2('100%', { size: 60, fill: 0x4CAF50 }); self.volumeText.anchor.set(0.5, 0.5); self.volumeText.x = 1024; self.volumeText.y = 1050; self.addChild(self.volumeText); // Create volume decrease button var volumeDownButton = LK.getAsset('playButton', { width: 150, height: 100, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); volumeDownButton.x = 700; volumeDownButton.y = 1000; self.addChild(volumeDownButton); var volumeDownText = new Text2('-', { size: 80, fill: 0xFFFFFF }); volumeDownText.anchor.set(0.5, 0.5); volumeDownText.x = 700; volumeDownText.y = 1000; self.addChild(volumeDownText); // Create volume increase button var volumeUpButton = LK.getAsset('playButton', { width: 150, height: 100, color: 0x4CAF50, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); volumeUpButton.x = 1348; volumeUpButton.y = 1000; self.addChild(volumeUpButton); var volumeUpText = new Text2('+', { size: 80, fill: 0xFFFFFF }); volumeUpText.anchor.set(0.5, 0.5); volumeUpText.x = 1348; volumeUpText.y = 1000; self.addChild(volumeUpText); // Create mute/unmute button var muteButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0xFF5722, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); muteButton.x = 1024; muteButton.y = 1300; self.addChild(muteButton); self.muteButtonText = new Text2('SESİ KAPAT / MUTE', { size: 60, fill: 0xFFFFFF }); self.muteButtonText.anchor.set(0.5, 0.5); self.muteButtonText.x = 1024; self.muteButtonText.y = 1300; self.addChild(self.muteButtonText); // Create back button var backButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); backButton.x = 1024; backButton.y = 2300; self.addChild(backButton); var backButtonText = new Text2('BACK / GERİ', { size: 80, fill: 0xFFFFFF }); backButtonText.anchor.set(0.5, 0.5); backButtonText.x = 1024; backButtonText.y = 2300; self.addChild(backButtonText); // Volume control functionality self.updateVolumeDisplay = function () { var percentage = Math.round(musicVolume * 100); self.volumeText.setText(percentage + '%'); if (isMuted) { self.muteButtonText.setText('SESİ AÇ / UNMUTE'); } else { self.muteButtonText.setText('SESİ KAPAT / MUTE'); } }; // Volume down button click handler volumeDownButton.down = function (x, y, obj) { if (musicVolume > 0) { musicVolume = Math.max(0, musicVolume - 0.1); storage.musicVolume = musicVolume; self.updateVolumeDisplay(); // Update current playing music volume if (!isMuted) { LK.playMusic(musicTracks[currentMusicIndex], { volume: musicVolume }); } } }; // Volume up button click handler volumeUpButton.down = function (x, y, obj) { if (musicVolume < 1) { musicVolume = Math.min(1, musicVolume + 0.1); storage.musicVolume = musicVolume; self.updateVolumeDisplay(); // Update current playing music volume if (!isMuted) { LK.playMusic(musicTracks[currentMusicIndex], { volume: musicVolume }); } } }; // Mute button click handler muteButton.down = function (x, y, obj) { isMuted = !isMuted; storage.isMuted = isMuted; self.updateVolumeDisplay(); if (isMuted) { LK.stopMusic(); } else { LK.playMusic(musicTracks[currentMusicIndex], { volume: musicVolume }); } }; // Back button click handler backButton.down = function (x, y, obj) { self.visible = false; }; return self; }); var TapEffect = Container.expand(function () { var self = Container.call(this); var effectGraphics = self.attachAsset('tapEffect', { anchorX: 0.5, anchorY: 0.5 }); self.startAnimation = function (x, y) { self.x = x; self.y = y; self.alpha = 0.7; self.scale.set(0.3); // Scale up and fade out tween(self.scale, { x: 1.5, y: 1.5 }, { duration: 300, easing: tween.easeOut }); tween(self, { alpha: 0 }, { duration: 300, onFinish: function onFinish() { self.destroy(); } }); }; return self; }); var WinPanel = Container.expand(function () { var self = Container.call(this); // Create win panel background var winBg = LK.getAsset('menuBackground', { width: 2048, height: 2732, color: 0x1a1a2e, shape: 'box', anchorX: 0, anchorY: 0 }); self.addChild(winBg); // Create congratulations title var titleText = new Text2('', { size: 120, fill: 0xFFD700 }); titleText.anchor.set(0.5, 0.5); titleText.x = 1024; titleText.y = 800; self.addChild(titleText); // Create win message var messageText = new Text2('', { size: 80, fill: 0xFFFFFF }); messageText.anchor.set(0.5, 0.5); messageText.x = 1024; messageText.y = 1200; self.addChild(messageText); // Create restart button var restartButton = LK.getAsset('playButton', { width: 400, height: 120, color: 0x4CAF50, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); restartButton.x = 1024; restartButton.y = 1600; self.addChild(restartButton); var restartButtonText = new Text2('', { size: 80, fill: 0xFFFFFF }); restartButtonText.anchor.set(0.5, 0.5); restartButtonText.x = 1024; restartButtonText.y = 1600; self.addChild(restartButtonText); // Create exit button var exitButton = LK.getAsset('exitButton', { width: 400, height: 120, color: 0xff4444, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); exitButton.x = 1024; exitButton.y = 1800; self.addChild(exitButton); var exitButtonText = new Text2('', { size: 80, fill: 0xFFFFFF }); exitButtonText.anchor.set(0.5, 0.5); exitButtonText.x = 1024; exitButtonText.y = 1800; self.addChild(exitButtonText); // Update win panel text based on current language self.updateWinText = function () { titleText.setText(translations[currentLanguage].megaZengin); messageText.setText(translations[currentLanguage].dunyaBile); restartButtonText.setText(translations[currentLanguage].yenidenBasla); exitButtonText.setText(translations[currentLanguage].oyundanCik); }; // Restart button click handler restartButton.down = function (x, y, obj) { // Reset game state totalCoins = 0; tapCount = 0; coinsPerTap = 1; gameStarted = false; // Clear storage storage.totalCoins = 0; storage.tapCount = 0; storage.autoClicker = false; storage.boostUpgrade = false; storage.bakery = false; storage.factory = false; storage.farm = false; storage.bank = false; storage.company = false; storage.apartment = false; storage.airport = false; storage.workers = false; storage.achievement_somurge = false; // Reset shop items for (var i = 0; i < shopItemsData.length; i++) { shopItemsData[i].owned = false; } // Update UI texts coinCountText.setText('$' + totalCoins); tapCountText.setText('Taps: ' + tapCount); coinsPerTapText.setText('$' + coinsPerTap + ' per tap'); // Hide win panel self.visible = false; // Show main menu mainMenu.visible = true; gameStarted = false; // Hide game UI coinCountText.visible = false; tapCountText.visible = false; coinsPerTapText.visible = false; shopButton.visible = false; menuButton.visible = false; achievementsButton.visible = false; // Disable game interactions game.interactive = false; game.buttonMode = false; // Close shop if open if (shopOpen) { shopOpen = false; tween(shopPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } }; // Exit button click handler exitButton.down = function (x, y, obj) { // Hide win panel self.visible = false; // Show main menu mainMenu.visible = true; gameStarted = false; // Hide game UI coinCountText.visible = false; tapCountText.visible = false; coinsPerTapText.visible = false; shopButton.visible = false; menuButton.visible = false; achievementsButton.visible = false; // Disable game interactions game.interactive = false; game.buttonMode = false; // Close shop if open if (shopOpen) { shopOpen = false; tween(shopPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1a1a2e }); /**** * Game Code ****/ // Bakery shop item is already fully implemented with: // - $500 cost in shopItemsData // - $10 per second passive income in game update loop // - Proper storage persistence // - Visual coin animations from bakery location var gameStarted = false; var totalCoins = storage.totalCoins || 0; var coinsPerTap = storage.boostUpgrade ? 2 : 1; var tapCount = storage.tapCount || 0; var coins = []; var goldenDollars = []; var tapEffects = []; var backgroundParticles = []; var bottomMenuOpen = false; // Language system variables var currentLanguage = storage.language || 'tr'; var translations = { tr: { coinClicker: 'COIN CLICKER', play: 'OYNA', info: 'BİLGİ', language: 'DİL', menu: 'MENÜ', shop: 'DÜKKAN', achievements: 'BAŞARIMLAR', exit: 'ÇIKIŞ', restart: 'YENİDEN BAŞLA', howToPlay: 'NASIL OYNANIR', tapToEarn: 'PARA KAZANMAK İÇİN EKRANA DOKUN', shopItems: 'DÜKKAN EŞYALARI:', autoClicker: 'Otomatik olarak para kazan', boost: 'Dokunma başına kazancını ikiye katla', bakery: 'Saniyede $10 kazan', factory: '30 saniyede $120 kazan', goldenDollars: 'ALTIN DOLARLAR:', rarelyFall: 'Nadiren gökten düşer', tapThem: 'Onlara dokunarak $50 kazan', buildFortune: 'SERVET KURU!', back: 'GERİ', perTap: 'dokunma başına', taps: 'Dokunma', yolunBasi: 'Yolun Başı', paraToplayici: 'Para Toplayıcı', tiklamaUstasi: 'Tıklama Ustası', altinAvcisi: 'Altın Avcısı', dukkanSahibi: 'Dükkan Sahibi', para: 'Para', zengin: 'Zengin', milyoner: 'Milyoner', ilkTikla: 'İlk tıklamanı yap', yuzDolar: '100 dolar biriktir', elliTikla: '50 kez tıkla', altinDolarYakala: 'Bir altın dolar yakala', ilkEsya: 'İlk eşyanı satın al', binDolar: '1000 dolar biriktir', yuzBinDolar: '100000 dolar biriktir', birMilyonDolar: '1000000 dolar biriktir', autoClickerName: 'Otomatik Tıklayıcı', autoClickerDesc: 'Otomatik olarak para kazan', boostName: '2X Güçlendirme', boostDesc: 'Dokunma başına kazancını ikiye katla', bakeryName: 'Fırın', bakeryDesc: 'Saniyede $10 kazan', factoryName: 'Fabrika', factoryDesc: '30 saniyede $70 kazan', farmName: 'Çiftlik', farmDesc: '5 saniyede $20 kazan', bankName: 'Banka', bankDesc: '10 saniyede $200 kazan', companyName: 'Şirket', companyDesc: '5 saniyede $400 kazan', apartmentName: 'Apartman', apartmentDesc: '10 saniyede $300 kazan', airportName: 'Havalimanı', airportDesc: '10 saniyede $4000 kazan', workersName: 'İşçiler', workersDesc: 'Tüm gelire 5x boost', somurge: 'Sömürgeci', tumEsyalar: 'Tüm eşyaları satın al', megaZengin: 'ARTIK MEGA ZENGİN OLDUN!', dunyaBile: 'Dünyayı bile alabilirsin.\nOynadığınız için teşekkürler!', yenidenBasla: 'YENİDEN BAŞLA', oyundanCik: 'OYUNDAN ÇIK' }, en: { coinClicker: 'COIN CLICKER', play: 'PLAY', info: 'INFO', language: 'LANGUAGE', menu: 'MENU', shop: 'SHOP', achievements: 'ACHIEVEMENTS', exit: 'EXIT', restart: 'RESTART', howToPlay: 'HOW TO PLAY', tapToEarn: 'TAP THE SCREEN TO EARN COINS', shopItems: 'SHOP ITEMS:', autoClicker: 'Automatically earn coins', boost: 'Double your coins per tap', bakery: 'Earn $10 every second', factory: 'Earn $120 every 30 seconds', goldenDollars: 'GOLDEN DOLLARS:', rarelyFall: 'Rarely fall from the sky', tapThem: 'Tap them to earn $50', buildFortune: 'BUILD YOUR FORTUNE!', back: 'BACK', perTap: 'per tap', taps: 'Taps', yolunBasi: 'The Beginning', paraToplayici: 'Coin Collector', tiklamaUstasi: 'Tap Master', altinAvcisi: 'Golden Hunter', dukkanSahibi: 'Shop Keeper', para: 'Money', zengin: 'Rich', milyoner: 'Millionaire', ilkTikla: 'Make your first tap', yuzDolar: 'Collect $100', elliTikla: 'Tap 50 times', altinDolarYakala: 'Catch a golden dollar', ilkEsya: 'Buy your first item', binDolar: 'Collect $1000', yuzBinDolar: 'Collect $100000', birMilyonDolar: 'Collect $1000000', autoClickerName: 'Auto Clicker', autoClickerDesc: 'Automatically earn coins', boostName: '2X Boost', boostDesc: 'Double your coins per tap', bakeryName: 'Bakery', bakeryDesc: 'Earn $10 every second', factoryName: 'Factory', factoryDesc: 'Earn $70 every 30 seconds', farmName: 'Farm', farmDesc: 'Earn $20 every 5 seconds', bankName: 'Bank', bankDesc: 'Earn $200 every 10 seconds', companyName: 'Company', companyDesc: 'Earn $400 every 5 seconds', apartmentName: 'Apartment', apartmentDesc: 'Earn $300 every 10 seconds', airportName: 'Airport', airportDesc: 'Earn $4000 every 10 seconds', workersName: 'Workers', workersDesc: '5x boost to all income', somurge: 'Colonist', tumEsyalar: 'Buy all shop items', megaZengin: 'YOU ARE NOW MEGA RICH!', dunyaBile: 'You can even buy the world.\nThanks for playing!', yenidenBasla: 'RESTART', oyundanCik: 'EXIT GAME' } }; // Achievement system variables var achievementsOpen = false; var achievementsData = [{ id: 'first_tap', name: 'Yolun Başı', description: 'İlk tıklamanı yap', unlocked: storage.achievement_first_tap || false }, { id: 'coin_collector', name: 'Para Toplayıcı', description: '100 dolar biriktir', unlocked: storage.achievement_coin_collector || false }, { id: 'tap_master', name: 'Tıklama Ustası', description: '50 kez tıkla', unlocked: storage.achievement_tap_master || false }, { id: 'golden_hunter', name: 'Altın Avcısı', description: 'Bir altın dolar yakala', unlocked: storage.achievement_golden_hunter || false }, { id: 'shop_keeper', name: 'Dükkan Sahibi', description: 'İlk eşyanı satın al', unlocked: storage.achievement_shop_keeper || false }, { id: 'par_achievement', name: 'Para', description: '1000 dolar biriktir', unlocked: storage.achievement_par || false }, { id: 'yuz_bin_dolar', name: 'Zengin', description: '100000 dolar biriktir', unlocked: storage.achievement_yuz_bin_dolar || false }, { id: 'milyoner', name: 'Milyoner', description: '1000000 dolar biriktir', unlocked: storage.achievement_milyoner || false }, { id: 'somurge', name: 'Sömürgeci', description: 'Tüm eşyaları satın al', unlocked: storage.achievement_somurge || false }]; // Create main menu var mainMenu = new MainMenu(); game.addChild(mainMenu); // Create info panel var infoPanel = new InfoPanel(); infoPanel.visible = false; game.addChild(infoPanel); // Create language panel var languagePanel = new LanguagePanel(); languagePanel.visible = false; game.addChild(languagePanel); // Function to update shop items with translations function updateShopItems() { if (shopItems && shopItems.length > 0) { // Update shop item names and descriptions for (var i = 0; i < shopItems.length; i++) { var itemContainer = shopItems[i]; if (itemContainer.children && itemContainer.children.length >= 4) { var nameText = itemContainer.children[1]; // Item name text var descText = itemContainer.children[2]; // Item description text if (i === 0) { // Auto Clicker nameText.setText(translations[currentLanguage].autoClickerName); descText.setText(translations[currentLanguage].autoClickerDesc); } else if (i === 1) { // 2X Boost nameText.setText(translations[currentLanguage].boostName); descText.setText(translations[currentLanguage].boostDesc); } else if (i === 2) { // Bakery nameText.setText(translations[currentLanguage].bakeryName); descText.setText(translations[currentLanguage].bakeryDesc); } else if (i === 3) { // Factory nameText.setText(translations[currentLanguage].factoryName); descText.setText(translations[currentLanguage].factoryDesc); } else if (i === 4) { // Farm nameText.setText(translations[currentLanguage].farmName); descText.setText(translations[currentLanguage].farmDesc); } else if (i === 5) { // Bank nameText.setText(translations[currentLanguage].bankName); descText.setText(translations[currentLanguage].bankDesc); } else if (i === 6) { // Company nameText.setText(translations[currentLanguage].companyName); descText.setText(translations[currentLanguage].companyDesc); } else if (i === 7) { // Apartment nameText.setText(translations[currentLanguage].apartmentName); descText.setText(translations[currentLanguage].apartmentDesc); } else if (i === 8) { // Airport nameText.setText(translations[currentLanguage].airportName); descText.setText(translations[currentLanguage].airportDesc); } else if (i === 9) { // Workers nameText.setText(translations[currentLanguage].workersName); descText.setText(translations[currentLanguage].workersDesc); } } } // Update shop title if (shopTitle) { shopTitle.setText(translations[currentLanguage].shop); } } } // Function to update language function updateLanguage() { // Update achievement data with current language achievementsData[0].name = translations[currentLanguage].yolunBasi; achievementsData[0].description = translations[currentLanguage].ilkTikla; achievementsData[1].name = translations[currentLanguage].paraToplayici; achievementsData[1].description = translations[currentLanguage].yuzDolar; achievementsData[2].name = translations[currentLanguage].tiklamaUstasi; achievementsData[2].description = translations[currentLanguage].elliTikla; achievementsData[3].name = translations[currentLanguage].altinAvcisi; achievementsData[3].description = translations[currentLanguage].altinDolarYakala; achievementsData[4].name = translations[currentLanguage].dukkanSahibi; achievementsData[4].description = translations[currentLanguage].ilkEsya; achievementsData[5].name = translations[currentLanguage].para; achievementsData[5].description = translations[currentLanguage].binDolar; achievementsData[6].name = translations[currentLanguage].zengin; achievementsData[6].description = translations[currentLanguage].yuzBinDolar; achievementsData[7].name = translations[currentLanguage].milyoner; achievementsData[7].description = translations[currentLanguage].birMilyonDolar; achievementsData[8].name = translations[currentLanguage].somurge; achievementsData[8].description = translations[currentLanguage].tumEsyalar; // Update UI texts only if they exist if (coinsPerTapText) { coinsPerTapText.setText('$' + coinsPerTap + ' ' + translations[currentLanguage].perTap); } if (tapCountText) { tapCountText.setText(translations[currentLanguage].taps + ': ' + tapCount); } if (achievementsButton) { achievementsButton.setText(translations[currentLanguage].achievements); } if (menuButton) { menuButton.setText(translations[currentLanguage].menu); } if (shopButton) { shopButton.setText(translations[currentLanguage].shop); } // Update bottom menu button texts if (bottomMenu && bottomMenu.exitButtonText && bottomMenu.restartButtonText) { bottomMenu.exitButtonText.setText(translations[currentLanguage].exit); bottomMenu.restartButtonText.setText(translations[currentLanguage].restart); } // Update achievement panel if (achievementPanel) { achievementPanel.updateAchievements(); } // Update shop items updateShopItems(); } // Create achievement panel var achievementPanel = new AchievementPanel(); achievementPanel.x = 2048; // Start hidden off-screen to the right game.addChild(achievementPanel); achievementPanel.updateAchievements(); // Initialize language updateLanguage(); // Create bottom menu var bottomMenu = new BottomMenu(); bottomMenu.y = 2732 + 300; // Start hidden off-screen at the bottom bottomMenu.visible = false; game.addChild(bottomMenu); // Create menu button var menuButton = new Text2('MENU', { size: 60, fill: 0xFFD700 }); menuButton.anchor.set(0, 1); menuButton.x = 20; menuButton.y = -20; menuButton.visible = false; // Hide initially LK.gui.bottomLeft.addChild(menuButton); // UI Elements var coinCountText = new Text2('$' + totalCoins, { size: 120, fill: 0xFFD700 }); coinCountText.anchor.set(0.5, 0); coinCountText.visible = false; // Hide initially LK.gui.top.addChild(coinCountText); var tapCountText = new Text2('Taps: ' + tapCount, { size: 60, fill: 0xFFFFFF }); tapCountText.anchor.set(0.5, 0); tapCountText.y = 150; tapCountText.visible = false; // Hide initially LK.gui.top.addChild(tapCountText); var coinsPerTapText = new Text2('$' + coinsPerTap + ' per tap', { size: 50, fill: 0x4CAF50 }); coinsPerTapText.anchor.set(0.5, 1); coinsPerTapText.visible = false; // Hide initially LK.gui.bottom.addChild(coinsPerTapText); // Shop system variables var shopOpen = false; var shopPanel = new Container(); var shopBackground = LK.getAsset('shopBackground', { width: 600, height: 2732, color: 0x2c2c54, shape: 'box', anchorX: 0, anchorY: 0 }); shopPanel.addChild(shopBackground); shopPanel.x = 2048; // Start hidden off-screen to the right game.addChild(shopPanel); // Shop toggle button var shopButton = new Text2('SHOP', { size: 80, fill: 0xFFD700 }); shopButton.anchor.set(1, 0); shopButton.x = -20; shopButton.y = 20; shopButton.visible = false; // Hide initially LK.gui.topRight.addChild(shopButton); // Achievements button var achievementsButton = new Text2('BAŞARIMLAR', { size: 50, fill: 0xFFD700 }); achievementsButton.anchor.set(1, 1); achievementsButton.x = -20; achievementsButton.y = -20; achievementsButton.visible = false; // Hide initially LK.gui.bottomRight.addChild(achievementsButton); // Disable game interactions initially game.interactive = false; game.buttonMode = false; // Shop items data var shopItemsData = [{ name: 'Auto Clicker', description: 'Automatically earn coins', cost: 500, owned: storage.autoClicker || false, type: 'upgrade' }, { name: '2X Boost', description: 'Double your coins per tap', cost: 120, owned: storage.boostUpgrade || false, type: 'upgrade' }, { name: 'Bakery', description: 'Earn $10 every second', cost: 500, owned: storage.bakery || false, type: 'upgrade' }, { name: 'Factory', description: 'Earn $120 every 30 seconds', cost: 2000, owned: storage.factory || false, type: 'upgrade' }, { name: 'Farm', description: 'Earn $20 every 5 seconds', cost: 1000, owned: storage.farm || false, type: 'upgrade' }, { name: 'Bank', description: 'Earn $200 every 10 seconds', cost: 5000, owned: storage.bank || false, type: 'upgrade' }, { name: 'Company', description: 'Earn $400 every 5 seconds', cost: 30000, owned: storage.company || false, type: 'upgrade' }, { name: 'Apartment', description: 'Earn $300 every 10 seconds', cost: 15000, owned: storage.apartment || false, type: 'upgrade' }, { name: 'Airport', description: 'Earn $4000 every 10 seconds', cost: 100000, owned: storage.airport || false, type: 'upgrade' }, { name: 'Workers', description: '5x boost to all income', cost: 50000, owned: storage.workers || false, type: 'upgrade' }]; // Shop UI elements var shopItems = []; var shopTitle = new Text2('SHOP', { size: 100, fill: 0xFFD700 }); shopTitle.anchor.set(0.5, 0); shopTitle.x = 300; shopTitle.y = 50; shopPanel.addChild(shopTitle); // Create shop item buttons for (var i = 0; i < shopItemsData.length; i++) { var itemContainer = new Container(); var itemBg = LK.getAsset('itemBg', { width: 550, height: 150, color: 0x3c3c5c, shape: 'box', anchorX: 0.5, anchorY: 0.5 }); var itemName = new Text2(shopItemsData[i].name, { size: 60, fill: 0xFFFFFF }); itemName.anchor.set(0.5, 0); itemName.y = -40; var itemDesc = new Text2(shopItemsData[i].description, { size: 40, fill: 0xCCCCCC }); itemDesc.anchor.set(0.5, 0); itemDesc.y = -5; var itemCost = new Text2('$' + shopItemsData[i].cost, { size: 50, fill: 0x4CAF50 }); itemCost.anchor.set(0.5, 0); itemCost.y = 30; itemContainer.addChild(itemBg); itemContainer.addChild(itemName); itemContainer.addChild(itemDesc); itemContainer.addChild(itemCost); shopItems.push(itemContainer); itemContainer.x = 300; itemContainer.y = 250 + i * 200; itemContainer.itemIndex = i; // Add click handler for shop items itemContainer.down = function (x, y, obj) { var itemIndex = this.itemIndex; if (itemIndex >= 0 && itemIndex < shopItemsData.length) { var item = shopItemsData[itemIndex]; if (item && totalCoins >= item.cost && !item.owned) { totalCoins -= item.cost; item.owned = true; // Apply item effects if (item.name === 'Auto Clicker') { storage.autoClicker = true; } else if (item.name === '2X Boost') { storage.boostUpgrade = true; coinsPerTap = 2; } else if (item.name === 'Bakery') { storage.bakery = true; } else if (item.name === 'Factory') { storage.factory = true; } else if (item.name === 'Farm') { storage.farm = true; } else if (item.name === 'Bank') { storage.bank = true; } else if (item.name === 'Company') { storage.company = true; } else if (item.name === 'Apartment') { storage.apartment = true; } else if (item.name === 'Airport') { storage.airport = true; } else if (item.name === 'Workers') { storage.workers = true; } // Update UI coinCountText.setText('$' + totalCoins); coinsPerTapText.setText('$' + coinsPerTap + ' per tap'); // Flash item green LK.effects.flashObject(this, 0x4CAF50, 500); // Save progress storage.totalCoins = totalCoins; // Check shop keeper achievement if (!storage.achievement_shop_keeper) { storage.achievement_shop_keeper = true; achievementsData[4].unlocked = true; achievementPanel.updateAchievements(); } } } }; shopPanel.addChild(itemContainer); } // Create background particles for (var i = 0; i < 15; i++) { var particle = new BackgroundParticle(); particle.x = Math.random() * 2048; particle.y = Math.random() * 2732; backgroundParticles.push(particle); game.addChild(particle); } // Shop button click handler shopButton.down = function (x, y, obj) { shopOpen = !shopOpen; var targetX = shopOpen ? 1448 : 2048; tween(shopPanel, { x: targetX }, { duration: 300, easing: tween.easeInOut }); }; // Menu button click handler menuButton.down = function (x, y, obj) { bottomMenuOpen = !bottomMenuOpen; bottomMenu.visible = true; var targetY = bottomMenuOpen ? 2432 : 2732 + 300; tween(bottomMenu, { y: targetY }, { duration: 300, easing: tween.easeInOut, onFinish: function onFinish() { if (!bottomMenuOpen) { bottomMenu.visible = false; } } }); }; // Achievements button click handler achievementsButton.down = function (x, y, obj) { achievementsOpen = !achievementsOpen; var targetX = achievementsOpen ? 1448 : 2048; tween(achievementPanel, { x: targetX }, { duration: 300, easing: tween.easeInOut }); }; // Main tap handler game.down = function (x, y, obj) { // Don't process taps if game hasn't started or shop is open or bottom menu is open if (!gameStarted || shopOpen || bottomMenuOpen) return; // Increase coin count totalCoins += coinsPerTap; tapCount++; // Update UI coinCountText.setText('$' + totalCoins); tapCountText.setText('Taps: ' + tapCount); // Create coin animation var coin = new Coin(); var targetX = 2048 / 2; var targetY = 200; coin.startAnimation(x, y, targetX, targetY); coins.push(coin); game.addChild(coin); // Create tap effect var tapEffect = new TapEffect(); tapEffect.startAnimation(x, y); tapEffects.push(tapEffect); game.addChild(tapEffect); // Play sounds LK.getSound('coinSound').play(); LK.getSound('tapSound').play(); // Removed automatic progression - coins per tap stays at 1 dollar // Make background particles react to taps for (var i = 0; i < backgroundParticles.length; i++) { var particle = backgroundParticles[i]; var distance = Math.sqrt(Math.pow(particle.x - x, 2) + Math.pow(particle.y - y, 2)); if (distance < 200) { tween(particle, { alpha: 0.8 }, { duration: 100 }); tween(particle, { alpha: particle.alpha }, { duration: 200 }); } } // Save progress storage.totalCoins = totalCoins; storage.tapCount = tapCount; // Check achievements checkAchievements(); }; // Function to check and unlock achievements function checkAchievements() { // Check first tap achievement if (tapCount >= 1 && !storage.achievement_first_tap) { storage.achievement_first_tap = true; achievementsData[0].unlocked = true; achievementPanel.updateAchievements(); } // Check coin collector achievement if (totalCoins >= 100 && !storage.achievement_coin_collector) { storage.achievement_coin_collector = true; achievementsData[1].unlocked = true; achievementPanel.updateAchievements(); } // Check tap master achievement if (tapCount >= 50 && !storage.achievement_tap_master) { storage.achievement_tap_master = true; achievementsData[2].unlocked = true; achievementPanel.updateAchievements(); } // Check par achievement (1000 dollars) if (totalCoins >= 1000 && !storage.achievement_par) { storage.achievement_par = true; achievementsData[5].unlocked = true; achievementPanel.updateAchievements(); } // Check 100,000 dollar achievement if (totalCoins >= 100000 && !storage.achievement_yuz_bin_dolar) { storage.achievement_yuz_bin_dolar = true; achievementsData[6].unlocked = true; achievementPanel.updateAchievements(); } // Check 1,000,000 dollar achievement (Millionaire) if (totalCoins >= 1000000 && !storage.achievement_milyoner) { storage.achievement_milyoner = true; achievementsData[7].unlocked = true; achievementPanel.updateAchievements(); } // Check win condition when reaching 1,000,000 coins if (totalCoins >= 1000000 && gameStarted && !winPanel.visible) { // Show win panel winPanel.updateWinText(); winPanel.visible = true; gameStarted = false; // Hide game UI coinCountText.visible = false; tapCountText.visible = false; coinsPerTapText.visible = false; shopButton.visible = false; menuButton.visible = false; achievementsButton.visible = false; // Disable game interactions game.interactive = false; game.buttonMode = false; // Close shop if open if (shopOpen) { shopOpen = false; tween(shopPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } // Close achievements if open if (achievementsOpen) { achievementsOpen = false; tween(achievementPanel, { x: 2048 }, { duration: 300, easing: tween.easeInOut }); } // Close bottom menu if open if (bottomMenuOpen) { bottomMenuOpen = false; bottomMenu.visible = false; bottomMenu.y = 2732 + 300; } // Early return after win condition to prevent further processing return; } // Check colony achievement (all shop items purchased) var allItemsOwned = true; for (var i = 0; i < shopItemsData.length; i++) { if (!shopItemsData[i].owned) { allItemsOwned = false; break; } } if (allItemsOwned && !storage.achievement_somurge) { storage.achievement_somurge = true; achievementsData[8].unlocked = true; achievementPanel.updateAchievements(); } } // Music system variables var musicTracks = ['rahat', 'eylen']; var currentMusicIndex = 0; var musicTimer = 0; var musicSwitchInterval = 1800; // 30 seconds at 60 FPS var musicVolume = storage.musicVolume || 1.0; var isMuted = storage.isMuted || false; // Create music settings panel var musicSettingsPanel = new MusicSettingsPanel(); musicSettingsPanel.visible = false; game.addChild(musicSettingsPanel); // Create win panel var winPanel = new WinPanel(); winPanel.visible = false; game.addChild(winPanel); // Play first background music console.log("Starting music system with track:", musicTracks[currentMusicIndex]); console.log("Available music tracks:", musicTracks); if (!isMuted) { LK.playMusic(musicTracks[currentMusicIndex], { volume: musicVolume }); } // Game update loop game.update = function () { // Auto-clicker functionality if (storage.autoClicker && LK.ticks % 120 === 0) { // Every 2 seconds var autoClickerIncome = Math.floor(coinsPerTap * 0.5); // 50% of manual tap value if (storage.workers) autoClickerIncome *= 5; // 5x boost from workers totalCoins += autoClickerIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create small coin animation at center var coin = new Coin(); var centerX = 2048 / 2; var centerY = 2732 / 2; coin.startAnimation(centerX, centerY, centerX, 200); coins.push(coin); game.addChild(coin); } // Bakery passive income - $10 every second (60 ticks) if (storage.bakery && LK.ticks % 60 === 0) { var bakeryIncome = 10; if (storage.workers) bakeryIncome *= 5; // 5x boost from workers totalCoins += bakeryIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create small coin animation from bottom right var coin = new Coin(); var bakeryX = 2048 - 100; var bakeryY = 2732 - 100; coin.startAnimation(bakeryX, bakeryY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Factory passive income - $120 every 30 seconds (1800 ticks) if (storage.factory && LK.ticks % 1800 === 0) { var factoryIncome = 120; if (storage.workers) factoryIncome *= 5; // 5x boost from workers totalCoins += factoryIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from bottom left var coin = new Coin(); var factoryX = 100; var factoryY = 2732 - 100; coin.startAnimation(factoryX, factoryY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Farm passive income - $20 every 5 seconds (300 ticks) if (storage.farm && LK.ticks % 300 === 0) { var farmIncome = 20; if (storage.workers) farmIncome *= 5; // 5x boost from workers totalCoins += farmIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from center left var coin = new Coin(); var farmX = 200; var farmY = 2732 / 2; coin.startAnimation(farmX, farmY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Bank passive income - $200 every 10 seconds (600 ticks) if (storage.bank && LK.ticks % 600 === 0) { var bankIncome = 200; if (storage.workers) bankIncome *= 5; // 5x boost from workers totalCoins += bankIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from top center var coin = new Coin(); var bankX = 2048 / 2; var bankY = 100; coin.startAnimation(bankX, bankY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Company passive income - $400 every 5 seconds (300 ticks) if (storage.company && LK.ticks % 300 === 0) { var companyIncome = 400; if (storage.workers) companyIncome *= 5; // 5x boost from workers totalCoins += companyIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from top right var coin = new Coin(); var companyX = 2048 - 200; var companyY = 200; coin.startAnimation(companyX, companyY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Apartment passive income - $300 every 10 seconds (600 ticks) if (storage.apartment && LK.ticks % 600 === 0) { var apartmentIncome = 300; if (storage.workers) apartmentIncome *= 5; // 5x boost from workers totalCoins += apartmentIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from center right var coin = new Coin(); var apartmentX = 2048 - 300; var apartmentY = 2732 / 2; coin.startAnimation(apartmentX, apartmentY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Airport passive income - $4000 every 10 seconds (600 ticks) if (storage.airport && LK.ticks % 600 === 0) { var airportIncome = 4000; if (storage.workers) airportIncome *= 5; // 5x boost from workers totalCoins += airportIncome; coinCountText.setText('$' + totalCoins); storage.totalCoins = totalCoins; checkAchievements(); // Create coin animation from top left var coin = new Coin(); var airportX = 300; var airportY = 300; coin.startAnimation(airportX, airportY, 2048 / 2, 200); coins.push(coin); game.addChild(coin); } // Clean up destroyed coins for (var i = coins.length - 1; i >= 0; i--) { if (coins[i].destroyed) { coins.splice(i, 1); } } // Clean up destroyed tap effects for (var i = tapEffects.length - 1; i >= 0; i--) { if (tapEffects[i].destroyed) { tapEffects.splice(i, 1); } } // Golden dollar spawning - 5% chance every 3 seconds (180 ticks) if (gameStarted && LK.ticks % 180 === 0 && Math.random() < 0.05) { var goldenDollar = new GoldenDollar(); goldenDollar.x = Math.random() * (2048 - 100) + 50; // Random X position within screen bounds goldenDollar.y = -50; // Start above screen goldenDollars.push(goldenDollar); game.addChild(goldenDollar); } // Clean up destroyed golden dollars for (var i = goldenDollars.length - 1; i >= 0; i--) { if (goldenDollars[i].destroyed) { goldenDollars.splice(i, 1); } } // Music switching system musicTimer++; if (musicTimer >= musicSwitchInterval) { musicTimer = 0; currentMusicIndex = (currentMusicIndex + 1) % musicTracks.length; console.log("Switching to music track:", musicTracks[currentMusicIndex]); if (!isMuted) { LK.playMusic(musicTracks[currentMusicIndex], { volume: musicVolume }); } } // Animate coin count text occasionally if (LK.ticks % 300 === 0) { tween(coinCountText.scale, { x: 1.1, y: 1.1 }, { duration: 150, easing: tween.easeOut }); tween(coinCountText.scale, { x: 1, y: 1 }, { duration: 150, easing: tween.easeIn }); } };
===================================================================
--- original.js
+++ change.js
@@ -1130,13 +1130,13 @@
/****
* Game Code
****/
-// - Visual coin animations from bakery location
-// - Proper storage persistence
-// - $10 per second passive income in game update loop
-// - $500 cost in shopItemsData
// Bakery shop item is already fully implemented with:
+// - $500 cost in shopItemsData
+// - $10 per second passive income in game update loop
+// - Proper storage persistence
+// - Visual coin animations from bakery location
var gameStarted = false;
var totalCoins = storage.totalCoins || 0;
var coinsPerTap = storage.boostUpgrade ? 2 : 1;
var tapCount = storage.tapCount || 0;
@@ -1864,8 +1864,10 @@
bottomMenuOpen = false;
bottomMenu.visible = false;
bottomMenu.y = 2732 + 300;
}
+ // Early return after win condition to prevent further processing
+ return;
}
// Check colony achievement (all shop items purchased)
var allItemsOwned = true;
for (var i = 0; i < shopItemsData.length; i++) {
@@ -1879,51 +1881,8 @@
achievementsData[8].unlocked = true;
achievementPanel.updateAchievements();
}
}
-// Check win condition - 1,000,000 coins
-if (totalCoins >= 1000000 && !winPanel.visible) {
- // Show win panel
- winPanel.updateWinText();
- winPanel.visible = true;
- gameStarted = false;
- // Hide game UI
- coinCountText.visible = false;
- tapCountText.visible = false;
- coinsPerTapText.visible = false;
- shopButton.visible = false;
- menuButton.visible = false;
- achievementsButton.visible = false;
- // Disable game interactions
- game.interactive = false;
- game.buttonMode = false;
- // Close shop if open
- if (shopOpen) {
- shopOpen = false;
- tween(shopPanel, {
- x: 2048
- }, {
- duration: 300,
- easing: tween.easeInOut
- });
- }
- // Close achievements if open
- if (achievementsOpen) {
- achievementsOpen = false;
- tween(achievementPanel, {
- x: 2048
- }, {
- duration: 300,
- easing: tween.easeInOut
- });
- }
- // Close bottom menu if open
- if (bottomMenuOpen) {
- bottomMenuOpen = false;
- bottomMenu.visible = false;
- bottomMenu.y = 2732 + 300;
- }
-}
// Music system variables
var musicTracks = ['rahat', 'eylen'];
var currentMusicIndex = 0;
var musicTimer = 0;
@@ -1955,8 +1914,9 @@
if (storage.workers) autoClickerIncome *= 5; // 5x boost from workers
totalCoins += autoClickerIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create small coin animation at center
var coin = new Coin();
var centerX = 2048 / 2;
var centerY = 2732 / 2;
@@ -1970,8 +1930,9 @@
if (storage.workers) bakeryIncome *= 5; // 5x boost from workers
totalCoins += bakeryIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create small coin animation from bottom right
var coin = new Coin();
var bakeryX = 2048 - 100;
var bakeryY = 2732 - 100;
@@ -1985,8 +1946,9 @@
if (storage.workers) factoryIncome *= 5; // 5x boost from workers
totalCoins += factoryIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from bottom left
var coin = new Coin();
var factoryX = 100;
var factoryY = 2732 - 100;
@@ -2000,8 +1962,9 @@
if (storage.workers) farmIncome *= 5; // 5x boost from workers
totalCoins += farmIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from center left
var coin = new Coin();
var farmX = 200;
var farmY = 2732 / 2;
@@ -2015,8 +1978,9 @@
if (storage.workers) bankIncome *= 5; // 5x boost from workers
totalCoins += bankIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from top center
var coin = new Coin();
var bankX = 2048 / 2;
var bankY = 100;
@@ -2030,8 +1994,9 @@
if (storage.workers) companyIncome *= 5; // 5x boost from workers
totalCoins += companyIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from top right
var coin = new Coin();
var companyX = 2048 - 200;
var companyY = 200;
@@ -2045,8 +2010,9 @@
if (storage.workers) apartmentIncome *= 5; // 5x boost from workers
totalCoins += apartmentIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from center right
var coin = new Coin();
var apartmentX = 2048 - 300;
var apartmentY = 2732 / 2;
@@ -2060,8 +2026,9 @@
if (storage.workers) airportIncome *= 5; // 5x boost from workers
totalCoins += airportIncome;
coinCountText.setText('$' + totalCoins);
storage.totalCoins = totalCoins;
+ checkAchievements();
// Create coin animation from top left
var coin = new Coin();
var airportX = 300;
var airportY = 300;