User prompt
Much bigger please ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
A bigger Explosion ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make a Partikel Explosion when a bubble Pops ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (2 edits merged)
Please save this source code
User prompt
Make the Partikels bigger ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Mach die Partikel im Hintergrund weg und die der goldenen bubble größer ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add an asset For the Partikels ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add so much more Partikels ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add more Partikels ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add partikels when a bubble Pops ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the Animations better and add more ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add small bubble to the Background
User prompt
Add a BG asset
User prompt
Spawn ein paar mehr Bubbles
Code edit (1 edits merged)
Please save this source code
User prompt
Mach es unendlich und Spawn nur halb so viele Bubbles
User prompt
Mach den Text wie vorher und mach die kleinen Bubbles größer
User prompt
Mach alles größer
Code edit (1 edits merged)
Please save this source code
User prompt
Bubble Pop Satisfaction
Initial prompt
Make a satisfying game
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Bubble = Container.expand(function () { var self = Container.call(this); self.bubbleType = 'normal'; self.speed = 2; self.size = 1; self.popped = false; var bubbleGraphics = self.attachAsset('bubble', { anchorX: 0.5, anchorY: 0.5 }); self.setType = function (type, size) { self.bubbleType = type; self.size = size || 1; if (type === 'golden') { self.removeChildren(); bubbleGraphics = self.attachAsset('goldenBubble', { anchorX: 0.5, anchorY: 0.5 }); bubbleGraphics.tint = 0xFFD700; } else if (size < 1) { self.removeChildren(); bubbleGraphics = self.attachAsset('smallBubble', { anchorX: 0.5, anchorY: 0.5 }); var colors = [0xFF6B6B, 0x4ECDC4, 0x45B7D1, 0xFDAA4C, 0xA8E6CF]; bubbleGraphics.tint = colors[Math.floor(Math.random() * colors.length)]; } else { var colors = [0xFF6B6B, 0x4ECDC4, 0x45B7D1, 0xFDAA4C, 0xA8E6CF]; bubbleGraphics.tint = colors[Math.floor(Math.random() * colors.length)]; } self.scaleX = self.scaleY = self.size * 2.0; }; self.pop = function () { if (self.popped) { return []; } self.popped = true; var newBubbles = []; if (self.bubbleType === 'golden') { LK.getSound('goldPop').play(); } else { LK.getSound('pop').play(); } tween(self, { scaleX: self.size * 2.4, scaleY: self.size * 2.4, alpha: 0 }, { duration: 300, easing: tween.easeOut }); if (self.size >= 1 && self.bubbleType !== 'golden') { var numBubbles = 2 + Math.floor(Math.random() * 2); for (var i = 0; i < numBubbles; i++) { var angle = Math.PI * 2 / numBubbles * i; newBubbles.push({ x: self.x + Math.cos(angle) * 80, y: self.y + Math.sin(angle) * 80, size: 0.5 }); } } return newBubbles; }; self.update = function () { if (!self.popped) { self.y -= self.speed; self.x += Math.sin(LK.ticks * 0.02 + self.y * 0.01) * 1.5; } }; self.down = function (x, y, obj) { if (!self.popped) { game.popBubble(self); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x1A237E }); /**** * Game Code ****/ game.setBackgroundColor(0x0D47A1); var bubbles = []; var missedBubbles = 0; var speedMultiplier = 1; var lastSpeedIncrease = 0; var comboCount = 0; var lastPopTime = 0; var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var missedTxt = new Text2('Missed: 0/10', { size: 100, fill: 0xFF6B6B }); missedTxt.anchor.set(1, 0); missedTxt.x = -20; LK.gui.topRight.addChild(missedTxt); var comboTxt = new Text2('', { size: 120, fill: 0xFFD700 }); comboTxt.anchor.set(0.5, 0.5); LK.gui.center.addChild(comboTxt); game.popBubble = function (bubble) { var currentTime = Date.now(); if (currentTime - lastPopTime < 1000) { comboCount++; if (comboCount > 2) { LK.getSound('combo').play(); comboTxt.setText('Combo x' + comboCount + '!'); comboTxt.alpha = 1; tween(comboTxt, { alpha: 0 }, { duration: 1000, easing: tween.easeOut }); } } else { comboCount = 1; } lastPopTime = currentTime; var points = 10; if (bubble.bubbleType === 'golden') { points = 100; clearAllBubbles(); } else { points *= comboCount; if (bubble.size < 1) { points = Math.floor(points * 0.5); } } LK.setScore(LK.getScore() + points); scoreTxt.setText(LK.getScore()); // Game is now infinite - no win condition var newBubbleData = bubble.pop(); for (var i = 0; i < newBubbleData.length; i++) { var data = newBubbleData[i]; var newBubble = new Bubble(); newBubble.setType('normal', data.size); newBubble.x = data.x; newBubble.y = data.y; newBubble.speed = speedMultiplier * 2; bubbles.push(newBubble); game.addChild(newBubble); } }; function clearAllBubbles() { for (var i = bubbles.length - 1; i >= 0; i--) { var bubble = bubbles[i]; if (!bubble.popped) { bubble.pop(); LK.setScore(LK.getScore() + 5); } } scoreTxt.setText(LK.getScore()); } function spawnBubble() { var bubble = new Bubble(); if (Math.random() < 0.05) { bubble.setType('golden'); } else { bubble.setType('normal'); } bubble.x = 200 + Math.random() * (2048 - 400); bubble.y = 2732 + 100; bubble.speed = speedMultiplier * (2 + Math.random() * 2); bubbles.push(bubble); game.addChild(bubble); } game.update = function () { if (LK.ticks - lastSpeedIncrease > 1800) { speedMultiplier += 0.2; lastSpeedIncrease = LK.ticks; } if (LK.ticks % Math.floor(80 / speedMultiplier) === 0) { spawnBubble(); } for (var i = bubbles.length - 1; i >= 0; i--) { var bubble = bubbles[i]; if (bubble.lastY === undefined) { bubble.lastY = bubble.y; } if (bubble.lastY > -100 && bubble.y <= -100 && !bubble.popped) { missedBubbles++; missedTxt.setText('Missed: ' + missedBubbles + '/10'); if (missedBubbles >= 10) { LK.showGameOver(); } bubble.destroy(); bubbles.splice(i, 1); continue; } if (bubble.popped && bubble.alpha <= 0) { bubble.destroy(); bubbles.splice(i, 1); continue; } bubble.lastY = bubble.y; } }; LK.playMusic('bgmusic');
===================================================================
--- original.js
+++ change.js
@@ -193,9 +193,9 @@
if (LK.ticks - lastSpeedIncrease > 1800) {
speedMultiplier += 0.2;
lastSpeedIncrease = LK.ticks;
}
- if (LK.ticks % Math.floor(120 / speedMultiplier) === 0) {
+ if (LK.ticks % Math.floor(80 / speedMultiplier) === 0) {
spawnBubble();
}
for (var i = bubbles.length - 1; i >= 0; i--) {
var bubble = bubbles[i];