User prompt
Fix skull Ballon not pop automatic
User prompt
Fix 100 / 100 balloons missing instead
User prompt
“skull balloons do not increase the missed balloons count when leaving the screen”.
User prompt
Fix bugs so skulls and balloons you can pop are not connected, make them separated, so when pop skull you loose, the other balloons give points and make game going forward
User prompt
Fix bugs
User prompt
Fix bug, so you only loose when touch skull balloons
User prompt
Fix bug so you get points for all red balloons, add more balloons in different colors
User prompt
Make the balloons bigger
User prompt
Add blue asset to a extra color balloon
User prompt
Lägg till asset blue ballong
User prompt
Use set asset to background
User prompt
Bake balloons you can not touch, if you do You loose and those balloon explode and have black colors with skulle on
User prompt
Make the game more challenging
User prompt
Make balloons in different sizes and every balloon have different speed, and make balloons in different colors, some balloons red, som blue, som yellow and so on...
User prompt
Make bigger balloons and in different colors
Code edit (1 edits merged)
Please save this source code
User prompt
Bubble Pop Frenzy
Initial prompt
Create a fun game satisfying
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Bubble = Container.expand(function () {
var self = Container.call(this);
self.isGolden = false;
self.bubbleSize = 1;
self.speed = 2;
self.floatSpeed = 0;
self.floatAmplitude = 0;
self.floatOffset = 0;
self.init = function (size, golden) {
self.bubbleSize = size;
self.isGolden = golden || false;
var bubbleGraphics = self.attachAsset(golden ? 'goldenBubble' : 'bubble', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: size,
scaleY: size
});
// Add shimmer effect to golden bubbles
if (golden) {
bubbleGraphics.alpha = 0.9;
}
// Set speed based on size (smaller = faster)
self.speed = 2 + (1 - size) * 3;
// Random floating movement
self.floatSpeed = 0.02 + Math.random() * 0.02;
self.floatAmplitude = 20 + Math.random() * 30;
self.floatOffset = Math.random() * Math.PI * 2;
};
self.update = function () {
// Move upward
self.y -= self.speed;
// Floating side-to-side movement
self.x += Math.sin(LK.ticks * self.floatSpeed + self.floatOffset) * self.floatAmplitude * 0.05;
};
self.getPoints = function () {
if (self.isGolden) {
return 50;
}
// Smaller bubbles worth more points
return Math.floor((2 - self.bubbleSize) * 20 + 5);
};
return self;
});
var Needle = Container.expand(function () {
var self = Container.call(this);
var needleGraphics = self.attachAsset('needle', {
anchorX: 0.5,
anchorY: 1.0
});
// Add a sharp point indicator at the top
var point = self.attachAsset('needle', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.3,
scaleY: 0.3,
y: -180
});
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
// Game variables
var needle;
var bubbles = [];
var missedBubbles = 0;
var maxMissedBubbles = 10;
var spawnTimer = 0;
var spawnDelay = 60;
var difficultyTimer = 0;
var goldenBubbleChance = 0.05;
// UI elements
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var missedTxt = new Text2('Missed: 0/' + maxMissedBubbles, {
size: 60,
fill: 0xFF0000
});
missedTxt.anchor.set(1, 0);
missedTxt.x = -20;
LK.gui.topRight.addChild(missedTxt);
// Create needle
needle = game.addChild(new Needle());
needle.x = 1024;
needle.y = 2400;
// Dragging logic
var dragNode = null;
game.down = function (x, y, obj) {
dragNode = needle;
handleMove(x, y, obj);
};
game.up = function (x, y, obj) {
dragNode = null;
};
function handleMove(x, y, obj) {
if (dragNode) {
dragNode.x = x;
dragNode.y = y;
}
}
game.move = handleMove;
// Game update loop
game.update = function () {
// Increase difficulty over time
difficultyTimer++;
if (difficultyTimer % 600 === 0 && spawnDelay > 20) {
spawnDelay -= 5;
}
// Spawn bubbles
spawnTimer++;
if (spawnTimer >= spawnDelay) {
spawnTimer = 0;
spawnBubble();
}
// Update bubbles
for (var i = bubbles.length - 1; i >= 0; i--) {
var bubble = bubbles[i];
// Track last position
if (bubble.lastY === undefined) bubble.lastY = bubble.y;
if (bubble.lastPopped === undefined) bubble.lastPopped = false;
// Check if bubble escaped off screen
if (bubble.lastY > -100 && bubble.y <= -100) {
if (!bubble.isGolden) {
missedBubbles++;
missedTxt.setText('Missed: ' + missedBubbles + '/' + maxMissedBubbles);
LK.getSound('miss').play();
if (missedBubbles >= maxMissedBubbles) {
LK.showGameOver();
}
}
bubble.destroy();
bubbles.splice(i, 1);
continue;
}
// Check collision with needle
var currentPopped = bubble.intersects(needle);
if (!bubble.lastPopped && currentPopped) {
// Pop the bubble
var points = bubble.getPoints();
LK.setScore(LK.getScore() + points);
scoreTxt.setText('Score: ' + LK.getScore());
// Play appropriate sound
if (bubble.isGolden) {
LK.getSound('bonus').play();
LK.effects.flashScreen(0xFFD700, 300);
} else {
LK.getSound('pop').play();
}
// Visual pop effect
tween(bubble, {
scaleX: 0,
scaleY: 0,
alpha: 0
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
bubble.destroy();
}
});
bubbles.splice(i, 1);
continue;
}
bubble.lastY = bubble.y;
bubble.lastPopped = currentPopped;
}
};
function spawnBubble() {
var bubble = new Bubble();
// Random size between 0.5 and 1.5
var size = 0.5 + Math.random();
// Check if it should be golden
var isGolden = Math.random() < goldenBubbleChance;
bubble.init(size, isGolden);
// Random x position
bubble.x = 100 + Math.random() * 1848;
bubble.y = 2832;
bubbles.push(bubble);
game.addChild(bubble);
} ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,200 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Bubble = Container.expand(function () {
+ var self = Container.call(this);
+ self.isGolden = false;
+ self.bubbleSize = 1;
+ self.speed = 2;
+ self.floatSpeed = 0;
+ self.floatAmplitude = 0;
+ self.floatOffset = 0;
+ self.init = function (size, golden) {
+ self.bubbleSize = size;
+ self.isGolden = golden || false;
+ var bubbleGraphics = self.attachAsset(golden ? 'goldenBubble' : 'bubble', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: size,
+ scaleY: size
+ });
+ // Add shimmer effect to golden bubbles
+ if (golden) {
+ bubbleGraphics.alpha = 0.9;
+ }
+ // Set speed based on size (smaller = faster)
+ self.speed = 2 + (1 - size) * 3;
+ // Random floating movement
+ self.floatSpeed = 0.02 + Math.random() * 0.02;
+ self.floatAmplitude = 20 + Math.random() * 30;
+ self.floatOffset = Math.random() * Math.PI * 2;
+ };
+ self.update = function () {
+ // Move upward
+ self.y -= self.speed;
+ // Floating side-to-side movement
+ self.x += Math.sin(LK.ticks * self.floatSpeed + self.floatOffset) * self.floatAmplitude * 0.05;
+ };
+ self.getPoints = function () {
+ if (self.isGolden) {
+ return 50;
+ }
+ // Smaller bubbles worth more points
+ return Math.floor((2 - self.bubbleSize) * 20 + 5);
+ };
+ return self;
+});
+var Needle = Container.expand(function () {
+ var self = Container.call(this);
+ var needleGraphics = self.attachAsset('needle', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ // Add a sharp point indicator at the top
+ var point = self.attachAsset('needle', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ scaleX: 0.3,
+ scaleY: 0.3,
+ y: -180
+ });
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x87CEEB
+});
+
+/****
+* Game Code
+****/
+// Game variables
+var needle;
+var bubbles = [];
+var missedBubbles = 0;
+var maxMissedBubbles = 10;
+var spawnTimer = 0;
+var spawnDelay = 60;
+var difficultyTimer = 0;
+var goldenBubbleChance = 0.05;
+// UI elements
+var scoreTxt = new Text2('Score: 0', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+var missedTxt = new Text2('Missed: 0/' + maxMissedBubbles, {
+ size: 60,
+ fill: 0xFF0000
+});
+missedTxt.anchor.set(1, 0);
+missedTxt.x = -20;
+LK.gui.topRight.addChild(missedTxt);
+// Create needle
+needle = game.addChild(new Needle());
+needle.x = 1024;
+needle.y = 2400;
+// Dragging logic
+var dragNode = null;
+game.down = function (x, y, obj) {
+ dragNode = needle;
+ handleMove(x, y, obj);
+};
+game.up = function (x, y, obj) {
+ dragNode = null;
+};
+function handleMove(x, y, obj) {
+ if (dragNode) {
+ dragNode.x = x;
+ dragNode.y = y;
+ }
+}
+game.move = handleMove;
+// Game update loop
+game.update = function () {
+ // Increase difficulty over time
+ difficultyTimer++;
+ if (difficultyTimer % 600 === 0 && spawnDelay > 20) {
+ spawnDelay -= 5;
+ }
+ // Spawn bubbles
+ spawnTimer++;
+ if (spawnTimer >= spawnDelay) {
+ spawnTimer = 0;
+ spawnBubble();
+ }
+ // Update bubbles
+ for (var i = bubbles.length - 1; i >= 0; i--) {
+ var bubble = bubbles[i];
+ // Track last position
+ if (bubble.lastY === undefined) bubble.lastY = bubble.y;
+ if (bubble.lastPopped === undefined) bubble.lastPopped = false;
+ // Check if bubble escaped off screen
+ if (bubble.lastY > -100 && bubble.y <= -100) {
+ if (!bubble.isGolden) {
+ missedBubbles++;
+ missedTxt.setText('Missed: ' + missedBubbles + '/' + maxMissedBubbles);
+ LK.getSound('miss').play();
+ if (missedBubbles >= maxMissedBubbles) {
+ LK.showGameOver();
+ }
+ }
+ bubble.destroy();
+ bubbles.splice(i, 1);
+ continue;
+ }
+ // Check collision with needle
+ var currentPopped = bubble.intersects(needle);
+ if (!bubble.lastPopped && currentPopped) {
+ // Pop the bubble
+ var points = bubble.getPoints();
+ LK.setScore(LK.getScore() + points);
+ scoreTxt.setText('Score: ' + LK.getScore());
+ // Play appropriate sound
+ if (bubble.isGolden) {
+ LK.getSound('bonus').play();
+ LK.effects.flashScreen(0xFFD700, 300);
+ } else {
+ LK.getSound('pop').play();
+ }
+ // Visual pop effect
+ tween(bubble, {
+ scaleX: 0,
+ scaleY: 0,
+ alpha: 0
+ }, {
+ duration: 200,
+ easing: tween.easeOut,
+ onFinish: function onFinish() {
+ bubble.destroy();
+ }
+ });
+ bubbles.splice(i, 1);
+ continue;
+ }
+ bubble.lastY = bubble.y;
+ bubble.lastPopped = currentPopped;
+ }
+};
+function spawnBubble() {
+ var bubble = new Bubble();
+ // Random size between 0.5 and 1.5
+ var size = 0.5 + Math.random();
+ // Check if it should be golden
+ var isGolden = Math.random() < goldenBubbleChance;
+ bubble.init(size, isGolden);
+ // Random x position
+ bubble.x = 100 + Math.random() * 1848;
+ bubble.y = 2832;
+ bubbles.push(bubble);
+ game.addChild(bubble);
+}
\ No newline at end of file
Skapa en realistic nål. No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
Create a cool sky background. In-Game asset. 2d. No shadows
Black Ballon with white skull on. In-Game asset. 2d. No shadows
Create a green Ballon with happy face. In-Game asset. 2d. No shadows