User prompt
update with: // Add these variables at the start of pufferMask var scaleHistory = new Array(5).fill(0); // Keep last 5 scale values var scaleIndex = 0; // Replace the scaling section in update(): if (facekit.leftEye && facekit.rightEye && facekit.mouthCenter) { var eyeDistance = Math.abs(facekit.rightEye.x - facekit.leftEye.x); var newScale = eyeDistance / 500; // Update rolling average scaleHistory[scaleIndex] = newScale; scaleIndex = (scaleIndex + 1) % scaleHistory.length; // Calculate average scale var avgScale = scaleHistory.reduce((a, b) => a + b, 0) / scaleHistory.length; // More gentle smoothing sprite.scaleX = sprite.scaleX * 0.85 + avgScale * 0.15; sprite.scaleY = sprite.scaleY * 0.85 + avgScale * 0.15; }
Code edit (1 edits merged)
Please save this source code
User prompt
update as needed with: // Track current growing bubble game.growingBubble = null; game.maxBubbleSize = 100; // Base max size before upgrades game.growthRate = 1; // Size units per 0.1 seconds (10 per second) // Add to game.update: if (facekit.mouthCenter && facekit.mouthOpen) { // Start or continue growing bubble if (!game.growingBubble) { game.growingBubble = new Bubble(); game.growingBubble.size = 25; // Minimum starting size game.addChild(game.growingBubble); game.bubbles.push(game.growingBubble); } // Update growing bubble position and size if (game.growingBubble) { game.growingBubble.x = facekit.mouthCenter.x; game.growingBubble.y = facekit.mouthCenter.y; game.growingBubble.size = Math.min( game.growingBubble.size + game.growthRate, game.maxBubbleSize ); game.growingBubble.verticalVelocity = 0; // Stay in place while growing game.growingBubble.driftX = 0; } } else if (game.growingBubble) { // Release bubble when mouth closes game.growingBubble.verticalVelocity = -5; // Initial downward velocity game.growingBubble.driftX = (Math.random() * 2 - 1) * 2; // Small random horizontal drift game.growingBubble = null; } βͺπ‘ Consider importing and using the following plugins: @upit/facekit.v1
User prompt
update as needed with: // Update these values at game initialization game.maxBubbleSize = 130; // Increased by 30% game.growthRate = 1.3; // Slightly increased to match new max size // Replace the mouth position check in game.update with: if (facekit.mouthOpen) { // Calculate spawn position relative to pufferfish mask var spawnX = playerMask.x; // Center of mask var spawnY = playerMask.y + (playerMask.height * 0.4); // 40% from bottom // Start or continue growing bubble if (!game.growingBubble) { game.growingBubble = new Bubble(); game.growingBubble.size = 25; // Keep minimum starting size game.addChild(game.growingBubble); game.bubbles.push(game.growingBubble); } // Update growing bubble position and size if (game.growingBubble) { game.growingBubble.x = spawnX; game.growingBubble.y = spawnY; game.growingBubble.size = Math.min( game.growingBubble.size + game.growthRate, game.maxBubbleSize ); game.growingBubble.verticalVelocity = 0; game.growingBubble.driftX = 0; } } else if (game.growingBubble) { // Stronger initial downward velocity when released game.growingBubble.verticalVelocity = -8; // Increased from -5 game.growingBubble.driftX = (Math.random() * 2 - 1) * 2.5; // Slightly increased drift game.growingBubble = null; } βͺπ‘ Consider importing and using the following plugins: @upit/facekit.v1
Code edit (6 edits merged)
Please save this source code
User prompt
update as needed with: var Bubble = Container.expand(function() { // ... existing init code ... self.lifetime = 0; self.AUTO_POP_SIZE = 40; self.MIN_SPLIT_SIZE = 30; self.update = function() { self.lifetime++; // Auto-pop small bubbles after 3 seconds if(self.size <= self.AUTO_POP_SIZE && self.lifetime > 180) { self.autoPop(); return; } // Clear off-screen bubbles if(self.y < -self.size || self.y > game.height + self.size) { self.destroy(); return; } // ... existing update code ... }; self.autoPop = function() { var points = Math.floor(self.getBP() * 0.5); // Half points for auto-pop game.addBP(points); self.destroy(); }; });
User prompt
update bubble with: self.lifetime = 0; self.AUTO_POP_SIZE = 40; self.MIN_SPLIT_SIZE = 30;
User prompt
update with: if (self.size > 60 && !self.justSplit) { var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); if(newSize >= self.MIN_SPLIT_SIZE) { for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } } }
User prompt
update as needed with: // Near other game variables game.MAX_BUBBLES = 125; game.baseSpawnRate = 180; // Every 3 seconds // In game update game.update = function() { // Only spawn if under max bubbles if(game.bubbles.length < game.MAX_BUBBLES) { if (LK.ticks % game.baseSpawnRate == 0) { var x = Math.random() * (game.width - 200) + 100; spawnSplitBubble(x, game.height + 100, 100, 0); } } // Clean up destroyed bubbles from array game.bubbles = game.bubbles.filter(function(bubble) { return !bubble.destroyed; }); // ... rest of update code ... };
User prompt
update with: if (LK.ticks % game.baseSpawnRate == 0) { console.log('Attempting spawn, bubbles:', game.bubbles.length); var x = Math.random() * (game.width - 200) + 100; spawnSplitBubble(x, game.height + 100, 100, 0); }
User prompt
update with: // Change this: if(self.y < -self.size || self.y > game.height + self.size) { self.destroy(); return; } // To this: if(self.y < -self.size) { self.destroy(); return; }
User prompt
update as needed with: // In Bubble class update: self.update = function() { self.lifetime++; // Auto-split large bubbles after 5 seconds if(self.size > 60 && self.lifetime > 300 && !self.justSplit) { var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } self.destroy(); return; } // Auto-pop smaller bubbles after 3 seconds if(self.size <= 70 && self.lifetime > 180) { self.autoPop(); return; }
User prompt
update with: self.update = function() { // Auto-split large bubbles at halfway point if(self.size > 60 && self.y < game.height/2 && !self.justSplit) { var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } self.destroy(); return; } // Auto-pop smaller bubbles near top if(self.size <= 70 && self.y < game.height/4) { self.autoPop(); return; }
User prompt
update with: self.autoPop = function() { var points = Math.floor(self.getBP() * 0.5); // Half points for auto-pop game.addBP(points); self.destroy(); // Just destroy, no splitting return; };
User prompt
update as needed with: self.down = function() { // ... cooldown check code ... game.addBP(points); // Only split if manually popped and large enough if(self.size > 60 && !self.justSplit) { var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } } self.destroy(); return true; };
User prompt
update with: self.lifetime++; // Only allow splits after bubble has existed for some frames if (self.lifetime < 10) { return; }
User prompt
update with: // Auto-split large bubbles at halfway point if (self.size > 60 && self.y < game.height / 2 && !self.justSplit && !self.hasSplit) { self.hasSplit = true; // Prevent future splits var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } self.destroy(); return; }
User prompt
update bubble with: var self = Container.call(this); self.lifetime = 0; self.hasSplit = false;
User prompt
update with: // Replace the fixed height check with a randomized range if (self.size > 60 && self.y < game.height * (Math.random() * 0.2 + 0.5) && !self.justSplit && !self.hasSplit) { self.hasSplit = true; // Prevent future splits var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1); } self.destroy(); return; }
User prompt
update with: function spawnSplitBubble(parentX, parentY, size, direction, isAutoPop = false) { var bubble = new Bubble(); bubble.x = parentX; bubble.y = parentY; bubble.size = size; bubble.justSplit = true; var speedMultiplier = 120 / size * (0.9 + Math.random() * 0.2); if (isAutoPop) { // Gentler split for auto-pops - mostly upward/sideways motion bubble.verticalVelocity = -(Math.random() * 1 + 2); // Reduced downward velocity bubble.driftX = direction * (Math.random() * 1.5 + 2); // Gentler spread } else { // Keep existing dramatic split for manual pops bubble.verticalVelocity = -(Math.random() * 2 + 4); bubble.driftX = direction * (Math.random() * 2 + 4); } bubble.floatSpeed = (45 + Math.random() * 10) / 60 * speedMultiplier; game.addChild(bubble); game.bubbles.push(bubble); }
User prompt
update with: if (self.size > 60 && self.y < game.height * (Math.random() * 0.2 + 0.5) && !self.justSplit && !self.hasSplit) { self.hasSplit = true; var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1, true); // true for autoPop } self.destroy(); return; }
User prompt
update with: // Auto-split large bubbles when they float high enough (but not while growing) if (self.size > 60 && self.y < game.height * 0.4 && // This means 60% from the bottom or higher !self.justSplit && !self.hasSplit && !game.growingBubble === self) { // Don't split if this is the currently growing bubble self.hasSplit = true; var newSize = Math.max(self.MIN_SPLIT_SIZE, self.size * 0.6); for (var i = 0; i < 2; i++) { spawnSplitBubble(self.x, self.y, newSize, i === 0 ? -1 : 1, true); } self.destroy(); return; }
User prompt
update with: if (self.size > 60 && self.y < game.height * 0.4 && // Top 40% of screen !self.justSplit && !self.hasSplit && self !== game.growingBubble) { // Correct comparison syntax
Code edit (3 edits merged)
Please save this source code
User prompt
update with: // Adjust bubble physics if (isAutoPop) { // More natural upward/sideways motion for auto-splits bubble.verticalVelocity = -(Math.random() * 2 + 3); // More upward drift bubble.driftX = direction * (Math.random() * 2.5 + 1.5); // More horizontal spread // Add slight random vertical variance bubble.floatSpeed = (55 + Math.random() * 15) / 60 * speedMultiplier; } else { // Manual pop physics - more dramatic split bubble.verticalVelocity = -(Math.random() * 2 + 4); bubble.driftX = direction * (Math.random() * 2 + 4); bubble.floatSpeed = (45 + Math.random() * 10) / 60 * speedMultiplier; }
===================================================================
--- original.js
+++ change.js
@@ -165,10 +165,10 @@
var playerMask = new pufferMask();
game.addChild(playerMask);
// Initialize game variables
game.growingBubble = null;
-game.maxBubbleSize = 100; // Base max size before upgrades
-game.growthRate = 1; // Size units per 0.1 seconds (10 per second)
+game.maxBubbleSize = 130; // Increased by 30%
+game.growthRate = 1.3; // Slightly increased to match new max size
function spawnSplitBubble(parentX, parentY, size, direction) {
var bubble = new Bubble();
bubble.x = parentX;
bubble.y = parentY;
@@ -210,28 +210,31 @@
bpText.text = formatBP(game.bp) + " BP";
};
game.update = function () {
// Add logic to grow and release bubbles based on facekit mouth state
- if (facekit.mouthCenter && facekit.mouthOpen) {
- // Start or continue growing bubble
+ if (facekit.mouthOpen) {
+ // Calculate spawn position relative to pufferfish mask
+ var spawnX = playerMask.x; // Center of mask
+ var spawnY = playerMask.y + playerMask.height * 0.4; // 40% from bottom
+ // Start or continue growing bubble
if (!game.growingBubble) {
game.growingBubble = new Bubble();
- game.growingBubble.size = 25; // Minimum starting size
+ game.growingBubble.size = 25; // Keep minimum starting size
game.addChild(game.growingBubble);
game.bubbles.push(game.growingBubble);
}
- // Update growing bubble position and size
+ // Update growing bubble position and size
if (game.growingBubble) {
- game.growingBubble.x = facekit.mouthCenter.x;
- game.growingBubble.y = facekit.mouthCenter.y;
+ game.growingBubble.x = spawnX;
+ game.growingBubble.y = spawnY;
game.growingBubble.size = Math.min(game.growingBubble.size + game.growthRate, game.maxBubbleSize);
- game.growingBubble.verticalVelocity = 0; // Stay in place while growing
+ game.growingBubble.verticalVelocity = 0;
game.growingBubble.driftX = 0;
}
} else if (game.growingBubble) {
- // Release bubble when mouth closes
- game.growingBubble.verticalVelocity = -5; // Initial downward velocity
- game.growingBubble.driftX = (Math.random() * 2 - 1) * 2; // Small random horizontal drift
+ // Stronger initial downward velocity when released
+ game.growingBubble.verticalVelocity = -8; // Increased from -5
+ game.growingBubble.driftX = (Math.random() * 2 - 1) * 2.5; // Slightly increased drift
game.growingBubble = null;
}
// Update all children (bubbles)
if (LK.ticks % 120 == 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