User prompt
Move the background initialization to before updateallupgrade texts
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Can't find variable: menuContainer' in or related to this line: 'menuContainer.addChild(tabContainer);' Line Number: 443
Code edit (6 edits merged)
Please save this source code
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'upgradeTexts.forEach')' in or related to this line: 'upgradeTexts.forEach(function (text) {' Line Number: 398
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'upgradeTexts.forEach')' in or related to this line: 'upgradeTexts.forEach(function (text) {' Line Number: 398
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'upgradeSections.bubbles')' in or related to this line: 'upgradeSections.bubbles.visible = true; // Show default tab' Line Number: 403
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'upgradeSections.bubbles')' in or related to this line: 'upgradeSections.bubbles.visible = true; // Show default tab' Line Number: 397
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'upgradeSections.bubbles')' in or related to this line: 'upgradeSections.bubbles.visible = true; // Show default tab' Line Number: 397
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'menuTextContainer.addChild')' in or related to this line: 'menuTextContainer.addChild(section);' Line Number: 406
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'menuTextContainer.addChild')' in or related to this line: 'menuTextContainer.addChild(section);' Line Number: 406
Code edit (2 edits merged)
Please save this source code
User prompt
Update with: // Set up menus var currentTab = 'bubbles'; // Default tab var menuTabs = ['bubbles', 'clams', 'colors', 'decorations']; var tabButtons = {}; // Will hold references to tab buttons var menuOpen = false; // Create menu container var menuContainer = new Container(); menuContainer.x = game.width / 2; menuContainer.y = game.height; // Position at bottom initially // Create upgrade button (visible when menu closed) var upgradeTab = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 1, y: 0, scaleX: 3, scaleY: 0.8, alpha: 0.9 }); // Add button text var upgradeText = new Text2("Upgrades", { size: 70, fill: 0xFFFFFF, stroke: 0x000000, strokeThickness: 3, font: "Impact" }); upgradeText.anchor = { x: 0.5, y: 0.5 }; upgradeText.x = 0; upgradeText.y = -upgradeTab.height * upgradeTab.scaleY / 2; upgradeTab.addChild(upgradeText); // Create main panel (full screen size minus margins) var menuPanel = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 0, y: -upgradeTab.height * upgradeTab.scaleY, // Position above the button scaleX: 2048 / 200, scaleY: (game.height - 2 * (upgradeTab.height * upgradeTab.scaleY)) / 299, alpha: 0.9 }); // Add panel and button to container menuContainer.addChild(menuPanel); menuContainer.addChild(upgradeTab); // Create text container for upgrades var menuTextContainer = new Container(); menuTextContainer.y = -menuPanel.height * menuPanel.scaleY / 2; // Center in panel menuContainer.addChild(menuTextContainer); // Create tab container at the bottom of the menu panel var tabContainer = new Container(); tabContainer.y = -menuPanel.height * menuPanel.scaleY + 100; // Position at bottom of panel menuContainer.addChild(tabContainer); // Create upgrade sections var upgradeSections = { bubbles: new Container(), clams: new Container(), colors: new Container(), decorations: new Container() }; // Add sections to text container Object.values(upgradeSections).forEach(function(section) { menuTextContainer.addChild(section); section.visible = false; // Hide all initially }); // Add menu container to game game.addChild(menuContainer);
User prompt
Update with: // Inside game.down function // Check if upgrade tab was clicked var localX = x - menuContainer.x; var localY = y - menuContainer.y; if (localX >= -upgradeTab.width * upgradeTab.scaleX / 2 && localX <= upgradeTab.width * upgradeTab.scaleX / 2 && localY >= -upgradeTab.height * upgradeTab.scaleY && localY <= 0) { menuOpen = !menuOpen; var targetY = menuOpen ? upgradeTab.height * upgradeTab.scaleY : game.height; if (menuOpen) { game.setChildIndex(menuContainer, game.children.length - 1); } tween(menuContainer, { y: targetY }, { duration: 300, easing: tween.easeOutBack, onFinish: function() { if (!menuOpen) { game.setChildIndex(menuContainer, 1); } } }); return true; } ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update only as needed with: // Set up menus var currentTab = 'bubbles'; // Default tab var menuTabs = ['bubbles', 'clams', 'colors', 'decorations']; var tabButtons = {}; // Will hold references to tab buttons var menuOpen = false; // Create menu container var menuContainer = new Container(); menuContainer.x = game.width / 2; menuContainer.y = game.height; // Position at bottom initially // Create main panel first (taller to fill more screen space) var menuPanel = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 1, // Anchor at bottom y: 0, scaleX: game.width / 200, scaleY: game.height * 0.8 / 299, // Make it taller - 80% of screen height alpha: 0.9 }); menuContainer.addChild(menuPanel); // Create upgrade button at top of panel var upgradeTab = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 1, // Anchor at bottom y: -menuPanel.height * menuPanel.scaleY, // Position at top of panel scaleX: 3, scaleY: 0.8, alpha: 0.9 }); menuContainer.addChild(upgradeTab); // Add upgrade text to button (correctly sized) var upgradeText = new Text2("Upgrades", { size: 70, fill: 0xFFFFFF, stroke: 0x000000, strokeThickness: 3, font: "Impact" }); upgradeText.anchor = { x: 0.5, y: 0.5 }; upgradeText.x = 0; upgradeText.y = -upgradeTab.height * upgradeTab.scaleY / 2; upgradeTab.addChild(upgradeText); // Create text container for upgrades var menuTextContainer = new Container(); menuTextContainer.y = -menuPanel.height * menuPanel.scaleY / 2; // Center in panel menuContainer.addChild(menuTextContainer); // Create upgrade sections var upgradeSections = { bubbles: new Container(), clams: new Container(), colors: new Container(), decorations: new Container() }; // Add sections to text container Object.values(upgradeSections).forEach(function(section) { menuTextContainer.addChild(section); section.visible = false; // Hide all initially }); // Create tab container at the BOTTOM of the menu panel var tabContainer = new Container(); tabContainer.y = -50; // Position near bottom of panel, adjust as needed menuContainer.addChild(tabContainer); function switchToTab(tabName) { if (currentTab === tabName) return; // Update current tab currentTab = tabName; // Highlight active tab highlightTab(tabName); // Hide all upgrade sections Object.values(upgradeSections).forEach(function(section) { section.visible = false; }); // Show selected section upgradeSections[tabName].visible = true; } function highlightTab(tabName) { // Reset all tabs Object.keys(tabButtons).forEach(function(tab) { tabButtons[tab].bg.alpha = 0.6; tabButtons[tab].text.fill = 0xFFFFFF; }); // Highlight selected tab tabButtons[tabName].bg.alpha = 1; tabButtons[tabName].text.fill = 0xFFFF00; } function initializeMenuTabs() { // Create tab buttons var tabWidth = menuPanel.width * menuPanel.scaleX / menuTabs.length; menuTabs.forEach(function(tabName, index) { // Create tab background var tabBg = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 0.5, x: (index - 1.5) * tabWidth + tabWidth / 2, scaleX: tabWidth / 200, scaleY: 0.5, alpha: 0.6 }); // Tab text var tabText = new Text2(tabName.charAt(0).toUpperCase() + tabName.slice(1), { size: 60, fill: 0xFFFFFF, stroke: 0x000000, strokeThickness: 2, font: "Impact" }); tabText.anchor = { x: 0.5, y: 0.5 }; tabText.x = (index - 1.5) * tabWidth + tabWidth / 2; // Add to tab container tabContainer.addChild(tabBg); tabContainer.addChild(tabText); // Store reference to tab button tabButtons[tabName] = { bg: tabBg, text: tabText }; // Add click handler tabBg.down = function() { switchToTab(tabName); return true; }; }); // Highlight default tab highlightTab(currentTab); // Show bubbles section by default upgradeSections.bubbles.visible = true; } // Add menu container to game game.addChild(menuContainer); initializeMenuTabs(); // Update click handling in game.down upgradeTab.down = function() { menuOpen = !menuOpen; var targetY = menuOpen ? menuPanel.height * menuPanel.scaleY : game.height; if (menuOpen) { game.setChildIndex(menuContainer, game.children.length - 1); } tween(menuContainer, { y: targetY }, { duration: 300, easing: tween.easeOutBack, onFinish: function() { if (!menuOpen) { game.setChildIndex(menuContainer, 1); } } }); return true; }; ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Update as needed with: // Set up menus var currentTab = 'bubbles'; // Default tab var menuTabs = ['bubbles', 'clams', 'colors', 'decorations']; var tabButtons = {}; // Will hold references to tab buttons var menuOpen = false; // Create menu container var menuContainer = new Container(); menuContainer.x = game.width / 2; menuContainer.y = game.height; // Position at bottom initially // Create main panel first (taller to fill more screen space) var menuPanel = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 1, // Anchor at bottom y: 0, scaleX: game.width / 200, scaleY: game.height * 0.8 / 299, // Make it taller - 80% of screen height alpha: 0.9 }); menuContainer.addChild(menuPanel); // Create upgrade button at top of panel var upgradeTab = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 1, // Anchor at bottom y: -menuPanel.height * menuPanel.scaleY, // Position at top of panel scaleX: 3, scaleY: 0.8, alpha: 0.9 }); menuContainer.addChild(upgradeTab); // Add upgrade text to button (correctly sized) var upgradeText = new Text2("Upgrades", { size: 70, fill: 0xFFFFFF, stroke: 0x000000, strokeThickness: 3, font: "Impact" }); upgradeText.anchor = { x: 0.5, y: 0.5 }; upgradeText.x = 0; upgradeText.y = -upgradeTab.height * upgradeTab.scaleY / 2; upgradeTab.addChild(upgradeText); // Create text container for upgrades var menuTextContainer = new Container(); menuTextContainer.y = -menuPanel.height * menuPanel.scaleY / 2; // Center in panel menuContainer.addChild(menuTextContainer); // Create upgrade sections var upgradeSections = { bubbles: new Container(), clams: new Container(), colors: new Container(), decorations: new Container() }; // Add sections to text container Object.values(upgradeSections).forEach(function(section) { menuTextContainer.addChild(section); section.visible = false; // Hide all initially }); // Create tab container at the BOTTOM of the menu panel var tabContainer = new Container(); tabContainer.y = -50; // Position near bottom of panel, adjust as needed menuContainer.addChild(tabContainer); function switchToTab(tabName) { if (currentTab === tabName) return; // Update current tab currentTab = tabName; // Highlight active tab highlightTab(tabName); // Hide all upgrade sections Object.values(upgradeSections).forEach(function(section) { section.visible = false; }); // Show selected section upgradeSections[tabName].visible = true; } function highlightTab(tabName) { // Reset all tabs Object.keys(tabButtons).forEach(function(tab) { tabButtons[tab].bg.alpha = 0.6; tabButtons[tab].text.fill = 0xFFFFFF; }); // Highlight selected tab tabButtons[tabName].bg.alpha = 1; tabButtons[tabName].text.fill = 0xFFFF00; } function initializeMenuTabs() { // Create tab buttons var tabWidth = menuPanel.width * menuPanel.scaleX / menuTabs.length; menuTabs.forEach(function(tabName, index) { // Create tab background var tabBg = LK.getAsset('upgradetab', { anchorX: 0.5, anchorY: 0.5, x: (index - 1.5) * tabWidth + tabWidth / 2, scaleX: tabWidth / 200, scaleY: 0.5, alpha: 0.6 }); // Tab text var tabText = new Text2(tabName.charAt(0).toUpperCase() + tabName.slice(1), { size: 60, fill: 0xFFFFFF, stroke: 0x000000, strokeThickness: 2, font: "Impact" }); tabText.anchor = { x: 0.5, y: 0.5 }; tabText.x = (index - 1.5) * tabWidth + tabWidth / 2; // Add to tab container tabContainer.addChild(tabBg); tabContainer.addChild(tabText); // Store reference to tab button tabButtons[tabName] = { bg: tabBg, text: tabText }; // Add click handler tabBg.down = function() { switchToTab(tabName); return true; }; }); // Highlight default tab highlightTab(currentTab); // Show bubbles section by default upgradeSections.bubbles.visible = true; } // Add menu container to game game.addChild(menuContainer); initializeMenuTabs(); // Update click handling in game.down upgradeTab.down = function() { menuOpen = !menuOpen; var targetY = menuOpen ? menuPanel.height * menuPanel.scaleY : game.height; if (menuOpen) { game.setChildIndex(menuContainer, game.children.length - 1); } tween(menuContainer, { y: targetY }, { duration: 300, easing: tween.easeOutBack, onFinish: function() { if (!menuOpen) { game.setChildIndex(menuContainer, 1); } } }); return true; }; ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Update with: // Update the tween function where menu is opened/closed tween(menuContainer, { y: targetY }, { duration: 300, easing: tween.easeOutBack, onUpdate: function(progress) { // Show tabs only when menu is fully open tabsContainer.visible = progress > 0.9 && menuOpen; }, onFinish: function() { tabsContainer.visible = menuOpen; if (!menuOpen) { game.setChildIndex(menuContainer, 1); } } }); ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (2 edits merged)
Please save this source code
User prompt
Update with: Object.values(tabContainers).forEach(function(tabContainer) { tabContainer.children.forEach(function (child) { // ...existing code that finds and updates text elements }); });
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'menuTextContainer.addChild')' in or related to this line: 'menuTextContainer.addChild(contentContainer);' Line Number: 741
User prompt
Please fix the bug: 'Can't find variable: getTabForUpgrade' in or related to this line: 'var targetContainer = tabContainers[getTabForUpgrade(category, key)];' Line Number: 914
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'menuTextContainer.addChild')' in or related to this line: 'menuTextContainer.addChild(contentContainer);' Line Number: 741
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'menuTextContainer.addChild')' in or related to this line: 'menuTextContainer.addChild(contentContainer);' Line Number: 741
===================================================================
--- original.js
+++ change.js
@@ -283,432 +283,9 @@
/****
* Game Code
****/
-function updateAllUpgradeTexts() {
- // Process bubble upgrades
- bubbleUpgrades.forEach(function (upgrade) {
- var category = upgrade[0];
- var key = upgrade[1];
- var upgradeConfig = UPGRADE_CONFIG[category][key];
- // Find the cost text for this upgrade in the bubbles section
- upgradeSections.bubbles.children.forEach(function (child) {
- if (child.text && child.text.includes("BP") && upgradeSections.bubbles.children.some(function (c) {
- return c.text === upgradeConfig.name && child.y > c.y;
- })) {
- // Check if max level reached
- if (upgradeConfig.currentLevel >= upgradeConfig.maxLevel) {
- child.setText("SOLD OUT");
- } else {
- child.setText(getUpgradeCost(upgradeConfig) + " BP");
- }
- }
- });
- });
- // Process clam upgrades
- clamUpgrades.forEach(function (upgrade) {
- var category = upgrade[0];
- var key = upgrade[1];
- if (category === 'machines') {
- var upgradeConfig = UPGRADE_CONFIG[category][key];
- var totalClams = UPGRADE_CONFIG.machines.basicClam.amount + UPGRADE_CONFIG.machines.advancedClam.amount + UPGRADE_CONFIG.machines.premiumClam.amount;
- // Find the cost text for this upgrade in the clams section
- upgradeSections.clams.children.forEach(function (child) {
- if (child.text && child.text.includes("BP") && upgradeSections.clams.children.some(function (c) {
- return c.text === upgradeConfig.name && child.y > c.y;
- })) {
- // Check if sold out based on clam logic
- if (totalClams >= 4 && key === 'basicClam' || UPGRADE_CONFIG.machines.basicClam.amount <= UPGRADE_CONFIG.machines.advancedClam.amount && key === 'advancedClam' || UPGRADE_CONFIG.machines.advancedClam.amount <= UPGRADE_CONFIG.machines.premiumClam.amount && key === 'premiumClam') {
- child.setText("SOLD OUT");
- } else {
- child.setText(getUpgradeCost(upgradeConfig) + " BP");
- }
- }
- });
- } else {
- var upgradeConfig = UPGRADE_CONFIG[category][key];
- // Find the cost text for this upgrade in the clams section
- upgradeSections.clams.children.forEach(function (child) {
- if (child.text && child.text.includes("BP") && upgradeSections.clams.children.some(function (c) {
- return c.text === upgradeConfig.name && child.y > c.y;
- })) {
- // Check if max level reached
- if (upgradeConfig.currentLevel >= upgradeConfig.maxLevel) {
- child.setText("SOLD OUT");
- } else {
- child.setText(getUpgradeCost(upgradeConfig) + " BP");
- }
- }
- });
- }
- });
- // Process color upgrades once implemented
- // colorUpgrades.forEach(function(upgrade) {
- // // Similar logic for color upgrades
- // });
- // Process decoration upgrades once implemented
- // decorationUpgrades.forEach(function(upgrade) {
- // // Similar logic for decoration upgrades
- // });
-}
-// Place upgrades in their respective tabs
-function initializeAllUpgrades() {
- // Add bubble upgrades
- bubbleUpgrades.forEach(function (upgrade, index) {
- createUpgradeText(upgrade[0], upgrade[1], index, index % 2 === 0, 'bubbles');
- });
- // Add clam upgrades
- clamUpgrades.forEach(function (upgrade, index) {
- createUpgradeText(upgrade[0], upgrade[1], index, index % 2 === 0, 'clams');
- });
- // Will add color and decoration upgrades later
-}
-// Now reorganize the upgrades
-var bubbleUpgrades = [['player', 'lungCapacity'], ['player', 'quickBreath'], ['machine', 'bubbleDurability']];
-var clamUpgrades = [['machines', 'basicClam'], ['machines', 'advancedClam'], ['machines', 'premiumClam'], ['machine', 'autoBubbleSpeed'], ['player', 'autoPop']];
-// Add color upgrades from the new plans
-var colorUpgrades = [
- // Will add color upgrades from the Prismatic Bubbles section later
-];
-// Add decoration upgrades from the new plans
-var decorationUpgrades = [
- // Will add Bubble Coral and Sunken Treasures later
-];
-// Create containers for each tab's content if not done already
-var upgradeSections = {
- bubbles: new Container(),
- clams: new Container(),
- colors: new Container(),
- decorations: new Container()
-};
-// Add section containers to menuTextContainer
-Object.values(upgradeSections).forEach(function (section) {
- menuTextContainer.addChild(section);
- section.visible = false; // Hide all initially
-});
-upgradeSections.bubbles.visible = true; // Show default tab
-// Function to highlight the active tab
-function highlightTab(tabName) {
- // Reset all tabs
- Object.keys(tabButtons).forEach(function (tab) {
- tabButtons[tab].bg.alpha = 0.8;
- tabButtons[tab].text.fill = 0xFFFFFF;
- });
- // Highlight selected tab
- tabButtons[tabName].bg.alpha = 1;
- tabButtons[tabName].text.fill = 0xFFFF00;
-}
-// Function to switch between tabs
-function switchToTab(tabName) {
- if (currentTab === tabName) {
- return;
- }
- // Update current tab
- currentTab = tabName;
- // Highlight active tab
- highlightTab(tabName);
- // Hide all upgrade sections
- Object.values(upgradeSections).forEach(function (section) {
- section.visible = false;
- });
- // Show selected section
- upgradeSections[tabName].visible = true;
-}
-function initializeMenuTabs() {
- // Create tab container at the bottom of the menu panel
- var tabContainer = new Container();
- tabContainer.y = -150; // Position above the bottom of the panel
- menuContainer.addChild(tabContainer);
- // Create tab buttons
- var tabWidth = menuPanel.width / menuTabs.length;
- menuTabs.forEach(function (tabName, index) {
- // Create tab background
- var tabBg = LK.getAsset('upgradetab', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: (index - 1.5) * tabWidth + tabWidth / 2,
- scaleX: tabWidth / 200,
- scaleY: 0.5,
- alpha: 0.8
- });
- // Tab text
- var tabText = new Text2(tabName.charAt(0).toUpperCase() + tabName.slice(1), {
- size: 60,
- fill: 0xFFFFFF,
- stroke: 0x000000,
- strokeThickness: 2,
- font: "Impact"
- });
- tabText.anchor = {
- x: 0.5,
- y: 0.5
- };
- tabText.x = (index - 1.5) * tabWidth + tabWidth / 2;
- // Add to tab container
- tabContainer.addChild(tabBg);
- tabContainer.addChild(tabText);
- // Store reference to tab button
- tabButtons[tabName] = {
- bg: tabBg,
- text: tabText
- };
- // Add click handler
- tabBg.down = function () {
- switchToTab(tabName);
- return true;
- };
- });
- // Highlight default tab
- highlightTab(currentTab);
-}
-var UPGRADE_EFFECTS = {
- lungCapacity: {
- baseValue: 160,
- // Base max bubble size
- incrementPercent: 25 // +25% per level
- },
- quickBreath: {
- baseValue: 1.6,
- // Base growth rate
- incrementPercent: 25 // +25% per level
- },
- autoBubbleSpeed: {
- decrementPercent: 10 // -10% production time per level
- },
- bubbleDurability: {
- extraSplits: 1 // +1 split per level
- },
- autoPop: {
- timeReduction: 0.8 // Reduces lifetime by 20% per level
- }
-};
-function _slicedToArray3(r, e) {
- return _arrayWithHoles3(r) || _iterableToArrayLimit3(r, e) || _unsupportedIterableToArray3(r, e) || _nonIterableRest3();
-}
-function _nonIterableRest3() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-function _unsupportedIterableToArray3(r, a) {
- if (r) {
- if ("string" == typeof r) {
- return _arrayLikeToArray3(r, a);
- }
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray3(r, a) : void 0;
- }
-}
-function _arrayLikeToArray3(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) {
- n[e] = r[e];
- }
- return n;
-}
-function _iterableToArrayLimit3(r, l) {
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t) {
- var e,
- n,
- i,
- u,
- a = [],
- f = !0,
- o = !1;
- try {
- if (i = (t = t.call(r)).next, 0 === l) {
- if (Object(t) !== t) {
- return;
- }
- f = !1;
- } else {
- for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
- ;
- }
- }
- } catch (r) {
- o = !0, n = r;
- } finally {
- try {
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) {
- return;
- }
- } finally {
- if (o) {
- throw n;
- }
- }
- }
- return a;
- }
-}
-function _arrayWithHoles3(r) {
- if (Array.isArray(r)) {
- return r;
- }
-}
-function getUpgradeCost(upgrade) {
- if (upgrade.amount !== undefined) {
- // For clams
- return Math.floor(upgrade.baseCost * Math.pow(upgrade.costScale, upgrade.amount));
- } else {
- // For regular upgrades
- return Math.floor(upgrade.baseCost * Math.pow(upgrade.costScale, upgrade.currentLevel));
- }
-}
-function _slicedToArray2(r, e) {
- return _arrayWithHoles2(r) || _iterableToArrayLimit2(r, e) || _unsupportedIterableToArray2(r, e) || _nonIterableRest2();
-}
-function _nonIterableRest2() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-function _unsupportedIterableToArray2(r, a) {
- if (r) {
- if ("string" == typeof r) {
- return _arrayLikeToArray2(r, a);
- }
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, a) : void 0;
- }
-}
-function _arrayLikeToArray2(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) {
- n[e] = r[e];
- }
- return n;
-}
-function _iterableToArrayLimit2(r, l) {
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t) {
- var e,
- n,
- i,
- u,
- a = [],
- f = !0,
- o = !1;
- try {
- if (i = (t = t.call(r)).next, 0 === l) {
- if (Object(t) !== t) {
- return;
- }
- f = !1;
- } else {
- for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
- ;
- }
- }
- } catch (r) {
- o = !0, n = r;
- } finally {
- try {
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) {
- return;
- }
- } finally {
- if (o) {
- throw n;
- }
- }
- }
- return a;
- }
-}
-function _arrayWithHoles2(r) {
- if (Array.isArray(r)) {
- return r;
- }
-}
-function updateClams() {
- if (!game.clamSpawnPoints) {
- return;
- }
- game.clamSpawnPoints.forEach(function (spawnPoint) {
- var config = UPGRADE_CONFIG.machines[spawnPoint.type];
- // Calculate production time with speed upgrade
- var baseTime = config.production * 60; // Convert to frames
- var speedMultiplier = Math.pow(1 - UPGRADE_EFFECTS.autoBubbleSpeed.decrementPercent / 100, UPGRADE_CONFIG.machine.autoBubbleSpeed.currentLevel);
- var adjustedTime = Math.max(1, Math.floor(baseTime * speedMultiplier));
- if (LK.ticks % adjustedTime === 0) {
- // Find first available bubble in pool
- var bubble = game.bubblePool.find(function (b) {
- return !b.visible;
- });
- if (bubble && game.activeBubbles.length < game.MAX_BUBBLES) {
- bubble.activate(spawnPoint.x, spawnPoint.y, config.bubbleSize, false // not player blown
- );
- // Set initial velocities for clam bubbles
- bubble.verticalVelocity = 0;
- bubble.driftX = (spawnPoint.isRight ? -1 : 1) * (Math.random() * 1.5 + 2);
- game.activeBubbles.push(bubble);
- }
- }
- });
-}
-function _slicedToArray(r, e) {
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
-}
-function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-function _unsupportedIterableToArray(r, a) {
- if (r) {
- if ("string" == typeof r) {
- return _arrayLikeToArray(r, a);
- }
- var t = {}.toString.call(r).slice(8, -1);
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
- }
-}
-function _arrayLikeToArray(r, a) {
- (null == a || a > r.length) && (a = r.length);
- for (var e = 0, n = Array(a); e < a; e++) {
- n[e] = r[e];
- }
- return n;
-}
-function _iterableToArrayLimit(r, l) {
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
- if (null != t) {
- var e,
- n,
- i,
- u,
- a = [],
- f = !0,
- o = !1;
- try {
- if (i = (t = t.call(r)).next, 0 === l) {
- if (Object(t) !== t) {
- return;
- }
- f = !1;
- } else {
- for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {
- ;
- }
- }
- } catch (r) {
- o = !0, n = r;
- } finally {
- try {
- if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) {
- return;
- }
- } finally {
- if (o) {
- throw n;
- }
- }
- }
- return a;
- }
-}
-function _arrayWithHoles(r) {
- if (Array.isArray(r)) {
- return r;
- }
-}
+// Initialize game variables
var background = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
x: game.width / 2,
@@ -723,50 +300,39 @@
player: {
lungCapacity: {
name: "Lung Capacity",
baseCost: 100,
- // About 1-2 max bubbles
costScale: 3.0,
- // Steeper scaling
maxLevel: 10,
currentLevel: 0
},
quickBreath: {
name: "Quick Breath",
baseCost: 100,
- // 2-3 max bubbles
costScale: 3.0,
- // Steeper scaling
maxLevel: 10,
currentLevel: 0
},
autoPop: {
- // Moved here from machine section
name: "Fish Friends",
- // Updated name
baseCost: 400,
- // Changed from 1000
costScale: 3,
maxLevel: 6,
- // Changed from 5
currentLevel: 0
}
},
machines: {
basicClam: {
name: "Basic Clam",
baseCost: 300,
- // 6-7 max bubbles
costScale: 2,
- // Slightly steeper scaling
amount: 0,
production: 3,
bubbleSize: 80
},
advancedClam: {
name: "Advanced Clam",
baseCost: 3000,
- // Requires running basic clams for a while
costScale: 3.0,
amount: 0,
production: 2,
bubbleSize: 100,
@@ -774,9 +340,8 @@
},
premiumClam: {
name: "Premium Clam",
baseCost: 20000,
- // True end-game content
costScale: 3,
amount: 0,
production: 1,
bubbleSize: 150,
@@ -787,9 +352,8 @@
bubbleDurability: {
name: "Bubble Splitting",
baseCost: 500,
costScale: 5,
- // Significant scaling
maxLevel: 3,
currentLevel: 0
},
autoBubbleSpeed: {
@@ -800,26 +364,42 @@
currentLevel: 0
}
}
};
+var UPGRADE_EFFECTS = {
+ lungCapacity: {
+ baseValue: 160,
+ incrementPercent: 25
+ },
+ quickBreath: {
+ baseValue: 1.6,
+ incrementPercent: 25
+ },
+ autoBubbleSpeed: {
+ decrementPercent: 10
+ },
+ bubbleDurability: {
+ extraSplits: 1
+ },
+ autoPop: {
+ timeReduction: 0.8
+ }
+};
game.showError = function (message) {
var errorText = new Text2(message, {
size: 120,
fill: 0xFF0000,
stroke: 0x000000,
strokeThickness: 5,
font: "Impact"
});
- // Set the anchor point to center the text
errorText.anchor = {
x: 0.5,
y: 0.5
};
- // Position at the center of the screen
errorText.x = game.width / 2;
errorText.y = game.height / 2;
game.addChild(errorText);
- // Animate the text
tween(errorText, {
alpha: 0,
y: errorText.y - 50
}, {
@@ -828,40 +408,220 @@
errorText.destroy();
}
});
};
+function getUpgradeCost(upgrade) {
+ if (upgrade.amount !== undefined) {
+ // For clams
+ return Math.floor(upgrade.baseCost * Math.pow(upgrade.costScale, upgrade.amount));
+ } else {
+ // For regular upgrades
+ return Math.floor(upgrade.baseCost * Math.pow(upgrade.costScale, upgrade.currentLevel));
+ }
+}
+function formatBP(value) {
+ var units = ['', 'K', 'M', 'B', 'T'];
+ var unitIndex = 0;
+ while (value >= 1000 && unitIndex < units.length - 1) {
+ value /= 1000;
+ unitIndex++;
+ }
+ return Math.floor(value * 10) / 10 + units[unitIndex];
+}
+// Set up menus
var currentTab = 'bubbles'; // Default tab
var menuTabs = ['bubbles', 'clams', 'colors', 'decorations'];
var tabButtons = {}; // Will hold references to tab buttons
-// Create upgrade menu elements
-// Menu tab (handle)
-// First position the panel relative to container at y=0
-// Menu panel should be below the tab in the container
-var menuTab = LK.getAsset('upgradetab', {
+var menuOpen = false;
+// Create menu container
+var menuContainer = new Container();
+menuContainer.x = game.width / 2;
+menuContainer.y = game.height; // Position at bottom initially
+// Create upgrade button (visible when menu closed)
+var upgradeButton = LK.getAsset('upgradetab', {
anchorX: 0.5,
anchorY: 1,
- // Change to bottom anchor
y: 0,
- // Will be at container's position
scaleX: 3,
scaleY: 0.8,
alpha: 0.9
});
+// Add button text
+var buttonText = new Text2("Upgrades", {
+ size: 70,
+ fill: 0xFFFFFF,
+ stroke: 0x000000,
+ strokeThickness: 3,
+ font: "Impact"
+});
+buttonText.anchor = {
+ x: 0.5,
+ y: 0.5
+};
+buttonText.x = 0;
+buttonText.y = -upgradeButton.height * upgradeButton.scaleY / 2;
+upgradeButton.addChild(buttonText);
+// Create main panel (full screen size minus margins)
var menuPanel = LK.getAsset('upgradetab', {
anchorX: 0.5,
anchorY: 0,
- y: -570,
+ y: -upgradeButton.height * upgradeButton.scaleY,
+ // Position above the button
+ scaleX: 2048 / 200,
+ scaleY: (game.height - 2 * (upgradeButton.height * upgradeButton.scaleY)) / 299,
+ alpha: 0.9
+});
+// Add panel and button to container
+menuContainer.addChild(menuPanel);
+menuContainer.addChild(upgradeButton);
+// Create tab container at the bottom of the menu panel
+var tabContainer = new Container();
+tabContainer.y = -menuPanel.height * menuPanel.scaleY + 100; // Position at bottom of panel
+menuContainer.addChild(tabContainer);
+// Create text container for upgrades
+var menuTextContainer = new Container();
+menuTextContainer.y = -menuPanel.height * menuPanel.scaleY / 2; // Center in panel
+menuContainer.addChild(menuTextContainer);
+// Create upgrade sections
+var upgradeSections = {
+ bubbles: new Container(),
+ clams: new Container(),
+ colors: new Container(),
+ decorations: new Container()
+};
+// Add sections to text container
+Object.values(upgradeSections).forEach(function (section) {
+ menuTextContainer.addChild(section);
+ section.visible = false; // Hide all initially
+});
+function switchToTab(tabName) {
+ if (currentTab === tabName) {
+ return;
+ }
+ // Update current tab
+ currentTab = tabName;
+ // Highlight active tab
+ highlightTab(tabName);
+ // Hide all upgrade sections
+ Object.values(upgradeSections).forEach(function (section) {
+ section.visible = false;
+ });
+ // Show selected section
+ upgradeSections[tabName].visible = true;
+}
+function highlightTab(tabName) {
+ // Reset all tabs
+ Object.keys(tabButtons).forEach(function (tab) {
+ tabButtons[tab].bg.alpha = 0.6;
+ tabButtons[tab].text.fill = 0xFFFFFF;
+ });
+ // Highlight selected tab
+ tabButtons[tabName].bg.alpha = 1;
+ tabButtons[tabName].text.fill = 0xFFFF00;
+}
+function initializeMenuTabs() {
+ // Create tab buttons
+ var tabWidth = menuPanel.width * menuPanel.scaleX / menuTabs.length;
+ menuTabs.forEach(function (tabName, index) {
+ // Create tab background
+ var tabBg = LK.getAsset('upgradetab', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: (index - 1.5) * tabWidth + tabWidth / 2,
+ scaleX: tabWidth / 200,
+ scaleY: 0.5,
+ alpha: 0.6
+ });
+ // Tab text
+ var tabText = new Text2(tabName.charAt(0).toUpperCase() + tabName.slice(1), {
+ size: 60,
+ fill: 0xFFFFFF,
+ stroke: 0x000000,
+ strokeThickness: 2,
+ font: "Impact"
+ });
+ tabText.anchor = {
+ x: 0.5,
+ y: 0.5
+ };
+ tabText.x = (index - 1.5) * tabWidth + tabWidth / 2;
+ // Add to tab container
+ tabContainer.addChild(tabBg);
+ tabContainer.addChild(tabText);
+ // Store reference to tab button
+ tabButtons[tabName] = {
+ bg: tabBg,
+ text: tabText
+ };
+ // Add click handler
+ tabBg.down = function () {
+ switchToTab(tabName);
+ return true;
+ };
+ });
+ // Highlight default tab
+ highlightTab(currentTab);
+ // Show bubbles section by default
+ upgradeSections.bubbles.visible = true;
+}
+// Handle menu open/close
+upgradeButton.down = function () {
+ toggleMenu();
+ return true;
+};
+function toggleMenu() {
+ menuOpen = !menuOpen;
+ // Calculate target position
+ var targetY = menuOpen ? upgradeButton.height * upgradeButton.scaleY : game.height;
+ // Bring menu to front when opening
+ if (menuOpen) {
+ game.setChildIndex(menuContainer, game.children.length - 1);
+ }
+ // Animate menu
+ tween(menuContainer, {
+ y: targetY
+ }, {
+ duration: 300,
+ easing: tween.easeOutBack,
+ onFinish: function onFinish() {
+ if (!menuOpen) {
+ game.setChildIndex(menuContainer, 1);
+ }
+ }
+ });
+}
+// Add menu container to game
+game.addChild(menuContainer);
+initializeMenuTabs();
+// Set up menus but but
+var currentTab = 'bubbles'; // Default tab
+var menuTabs = ['bubbles', 'clams', 'colors', 'decorations'];
+var tabButtons = {}; // Will hold references to tab buttons
+// Create menu container
+var menuContainer = new Container();
+menuContainer.x = game.width / 2;
+menuContainer.y = game.height; // Position at bottom
+// Create menu panel and tab
+var menuPanel = LK.getAsset('upgradetab', {
+ anchorX: 0.5,
+ anchorY: 0,
+ y: 0,
alpha: 0.9,
scaleX: 2048 / 200,
- // Use the width of the asset directly
- scaleY: game.height * 0.4 / 100.3
+ scaleY: game.height * 0.4 / 299
});
-// Initialize menu structure
-// Initialize menu container at the right position
-// Add panel first (so it's behind tab)
+var menuTab = LK.getAsset('upgradetab', {
+ anchorX: 0.5,
+ anchorY: 1,
+ y: -menuPanel.height * menuPanel.scaleY,
+ scaleX: 3,
+ scaleY: 0.8,
+ alpha: 0.9
+});
+// Add panel and tab to container
menuContainer.addChild(menuPanel);
menuContainer.addChild(menuTab);
-// Menu text setup - should be good as is
+// Add menu text
var menuText = new Text2("Upgrades", {
size: 90,
fill: 0xFFFFFF,
stroke: 0x000000,
@@ -872,36 +632,34 @@
x: 0.5,
y: 0.5
};
menuText.x = 0; // Relative to container
-menuText.y = -menuTab.height / 2; // Position relative to container bottom
+menuText.y = -menuPanel.height * menuPanel.scaleY - menuTab.height * menuTab.scaleY / 2; // Position relative to container bottom
menuContainer.addChild(menuText);
-// Add to game
+// Add menu container to game
game.addChild(menuContainer);
-// Create text container AFTER panel scaling
+// Create text container for upgrades
var menuTextContainer = new Container();
menuContainer.addChild(menuTextContainer);
+// Create upgrade sections
var upgradeSections = {
bubbles: new Container(),
clams: new Container(),
colors: new Container(),
decorations: new Container()
};
+// Add sections to text container
Object.values(upgradeSections).forEach(function (section) {
menuTextContainer.addChild(section);
section.visible = false; // Hide all initially
});
-initializeMenuTabs();
-initializeAllUpgrades();
-upgradeSections.bubbles.visible = true; // Show default tab
var startY = 150;
var upgradeSpacing = 250;
var columnWidth = 1024;
-// Function to create upgrade text
function createUpgradeText(category, key, index, isLeftColumn, tabSection) {
var upgrade = UPGRADE_CONFIG[category][key];
var xOffset = isLeftColumn ? -550 : 100;
- var yPos = startY + index * upgradeSpacing;
+ var yPos = startY + index % 5 * upgradeSpacing;
// Create hit container first (so it's behind text)
var hitContainer = new Container();
// Create a shape for the hit area
var hitArea = LK.getAsset('blower', {
@@ -941,16 +699,93 @@
hitContainer.down = function () {
// Your existing upgrade logic here
return true;
};
- // Add to the correct section instead of menuTextContainer
+ // Add to the correct section
upgradeSections[tabSection].addChild(hitContainer);
upgradeSections[tabSection].addChild(nameText);
upgradeSections[tabSection].addChild(costText);
}
-// Menu state and animation
-var menuOpen = false;
-var menuTargetY = game.height;
+// Organize upgrades by tab
+var bubbleUpgrades = [['player', 'lungCapacity'], ['player', 'quickBreath'], ['machine', 'bubbleDurability']];
+var clamUpgrades = [['machines', 'basicClam'], ['machines', 'advancedClam'], ['machines', 'premiumClam'], ['machine', 'autoBubbleSpeed'], ['player', 'autoPop']];
+// Add color upgrades from the new plans
+var colorUpgrades = [
+ // Will add color upgrades from the Prismatic Bubbles section later
+];
+// Add decoration upgrades from the new plans
+var decorationUpgrades = [
+ // Will add Bubble Coral and Sunken Treasures later
+];
+function initializeAllUpgrades() {
+ // Add bubble upgrades
+ bubbleUpgrades.forEach(function (upgrade, index) {
+ createUpgradeText(upgrade[0], upgrade[1], index, index % 2 === 0, 'bubbles');
+ });
+ // Add clam upgrades
+ clamUpgrades.forEach(function (upgrade, index) {
+ createUpgradeText(upgrade[0], upgrade[1], index, index % 2 === 0, 'clams');
+ });
+ // Will add color and decoration upgrades later
+}
+function updateAllUpgradeTexts() {
+ // Process bubble upgrades
+ bubbleUpgrades.forEach(function (upgrade) {
+ var category = upgrade[0];
+ var key = upgrade[1];
+ var upgradeConfig = UPGRADE_CONFIG[category][key];
+ // Find the cost text for this upgrade in the bubbles section
+ upgradeSections.bubbles.children.forEach(function (child) {
+ if (child.text && child.text.includes("BP") && upgradeSections.bubbles.children.some(function (c) {
+ return c.text === upgradeConfig.name && child.y > c.y;
+ })) {
+ // Check if max level reached
+ if (upgradeConfig.currentLevel >= upgradeConfig.maxLevel) {
+ child.setText("SOLD OUT");
+ } else {
+ child.setText(getUpgradeCost(upgradeConfig) + " BP");
+ }
+ }
+ });
+ });
+ // Process clam upgrades
+ clamUpgrades.forEach(function (upgrade) {
+ var category = upgrade[0];
+ var key = upgrade[1];
+ if (category === 'machines') {
+ var upgradeConfig = UPGRADE_CONFIG[category][key];
+ var totalClams = UPGRADE_CONFIG.machines.basicClam.amount + UPGRADE_CONFIG.machines.advancedClam.amount + UPGRADE_CONFIG.machines.premiumClam.amount;
+ // Find the cost text for this upgrade in the clams section
+ upgradeSections.clams.children.forEach(function (child) {
+ if (child.text && child.text.includes("BP") && upgradeSections.clams.children.some(function (c) {
+ return c.text === upgradeConfig.name && child.y > c.y;
+ })) {
+ // Check if sold out based on clam logic
+ if (totalClams >= 4 && key === 'basicClam' || UPGRADE_CONFIG.machines.basicClam.amount <= UPGRADE_CONFIG.machines.advancedClam.amount && key === 'advancedClam' || UPGRADE_CONFIG.machines.advancedClam.amount <= UPGRADE_CONFIG.machines.premiumClam.amount && key === 'premiumClam') {
+ child.setText("SOLD OUT");
+ } else {
+ child.setText(getUpgradeCost(upgradeConfig) + " BP");
+ }
+ }
+ });
+ } else {
+ var upgradeConfig = UPGRADE_CONFIG[category][key];
+ // Find the cost text for this upgrade in the clams section
+ upgradeSections.clams.children.forEach(function (child) {
+ if (child.text && child.text.includes("BP") && upgradeSections.clams.children.some(function (c) {
+ return c.text === upgradeConfig.name && child.y > c.y;
+ })) {
+ // Check if max level reached
+ if (upgradeConfig.currentLevel >= upgradeConfig.maxLevel) {
+ child.setText("SOLD OUT");
+ } else {
+ child.setText(getUpgradeCost(upgradeConfig) + " BP");
+ }
+ }
+ });
+ }
+ });
+}
function updateClamVisuals() {
while (clamContainer.children.length) {
clamContainer.children[0].destroy();
}
@@ -1004,12 +839,8 @@
});
clamContainer.addChild(sprite);
});
}
-updateClamVisuals();
-// Add this to the end of the game initialization code, after updating the clam visuals
-// Call the function after creating all upgrades
-updateAllUpgradeTexts();
// Initialize game variables
game.growingBubble = null;
game.lastMouthState = false; // Track previous mouth state
game.mouthOpenDuration = 0; // Track how long mouth has been open
@@ -1051,24 +882,14 @@
}
game.activeBubbles.push(bubble);
return bubble;
}
-// Initialize game variables
-//<Assets used in the game will automatically appear here>
+// Initialize BP system
game.bp = 0; // Track total BP
game.combo = 0;
game.lastPopTime = 0;
game.COMBO_WINDOW = 60; // 1 second in frames
-function formatBP(value) {
- var units = ['', 'K', 'M', 'B', 'T'];
- var unitIndex = 0;
- while (value >= 1000 && unitIndex < units.length - 1) {
- value /= 1000;
- unitIndex++;
- }
- return Math.floor(value * 10) / 10 + units[unitIndex];
-}
-// Create BP display text (add near game initialization)
+// Create BP display text
var bpText = new Text2("0 BP", {
size: 120,
fill: 0xFFFFFF,
stroke: 0x33caf8,
@@ -1150,8 +971,46 @@
}
});
}
};
+// Menu state and animation
+var menuOpen = false;
+var menuTargetY = game.height;
+function updateClams() {
+ if (!game.clamSpawnPoints) {
+ return;
+ }
+ game.clamSpawnPoints.forEach(function (spawnPoint) {
+ var config = UPGRADE_CONFIG.machines[spawnPoint.type];
+ // Calculate production time with speed upgrade
+ var baseTime = config.production * 60; // Convert to frames
+ var speedMultiplier = Math.pow(1 - UPGRADE_EFFECTS.autoBubbleSpeed.decrementPercent / 100, UPGRADE_CONFIG.machine.autoBubbleSpeed.currentLevel);
+ var adjustedTime = Math.max(1, Math.floor(baseTime * speedMultiplier));
+ if (LK.ticks % adjustedTime === 0) {
+ // Find first available bubble in pool
+ var bubble = game.bubblePool.find(function (b) {
+ return !b.visible;
+ });
+ if (bubble && game.activeBubbles.length < game.MAX_BUBBLES) {
+ bubble.activate(spawnPoint.x, spawnPoint.y, config.bubbleSize, false // not player blown
+ );
+ // Set initial velocities for clam bubbles
+ bubble.verticalVelocity = 0;
+ bubble.driftX = (spawnPoint.isRight ? -1 : 1) * (Math.random() * 1.5 + 2);
+ game.activeBubbles.push(bubble);
+ }
+ }
+ });
+}
+// Set the default visible tab
+upgradeSections.bubbles.visible = true;
+// Initialize tabs and upgrades
+initializeMenuTabs();
+initializeAllUpgrades();
+// Update clam visuals initially
+updateClamVisuals();
+// Update upgrade texts initially
+updateAllUpgradeTexts();
game.update = function () {
// Update mouth state and duration
if (!game.lastMouthState) {
game.mouthOpenDuration = 0;
A treasure chest with gold coins. Cartoon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A golden skull with diamonds for eyes. Cartoon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A golden necklace with a ruby pendant. Cartoon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A filled in white circle.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A yellow star. Cartoon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
a game logo for a game called 'Bubble Blower Tycoon' about a happy purple pufferfish with yellow fins and spines that builds an underwater empire of bubbles. Cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
an SVG of the word 'Start'. word should be yellow and the font should look like its made out of bubbles. cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
bubblelow
Sound effect
backgroundmusic
Music
bubblehigh
Sound effect
bubble1
Sound effect
bubble2
Sound effect
bubble3
Sound effect
bubble4
Sound effect
blowing
Sound effect
bubbleshoot
Sound effect
fishtank
Sound effect
menuopen
Sound effect
upgrade
Sound effect
jellyfish
Sound effect
titlemusic
Music
startbutton
Sound effect