Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
before calling showGameOver flash screen white
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (23 edits merged)
Please save this source code
User prompt
implement //Loop over rows, if a row only has empty values in it, remove it.
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'game.addChildAt(currentBubble, particleInjectionZIndex);' Line Number: 555
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'currentBubble = hintBubbles[hintBubbleOffset] = new HintBubble();' Line Number: 554
Code edit (10 edits merged)
Please save this source code
User prompt
implement self.printRowsToConsole = function () { //Prints nice representation of the rows grid to console as a string };
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (14 edits merged)
Please save this source code
User prompt
We have the pixel offsets for the bubbles around offsetPositions, however we also want to offset in terms of offset in the rows / columns grid. Can you add that as rx: and ry:
User prompt
Add row / column offsets to offsetPositions
User prompt
implement //Loop trough the offsetPositions and find the one that bubble is closest to
Code edit (4 edits merged)
Please save this source code
User prompt
implement //Calculate the position of potential neighbour bubbles into a list here
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -13,8 +13,16 @@
var bubbleGraphics = self.attachAsset('bubble', {
anchorX: 0.5,
anchorY: 0.5
});
+ var bubbleShine = self.attachAsset('bubbleshine', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ bubbleShine.x = -30;
+ bubbleShine.y = -30;
+ bubbleShine.alpha = .7;
+ bubbleShine.blendMode = 1;
var state = 0;
var targetX = 0;
var targetY = 0;
var isAttached = true;
@@ -39,18 +47,18 @@
if (!isAttached) {
self.x += speedX;
self.y += speedY;
speedY += 1.5;
- if (self.x < self.width / 2 && speedX < 0 || self.x > game.width - self.width / 2 && speedX > 0) {
+ if (self.x < bubbleSize / 2 && speedX < 0 || self.x > game.width - bubbleSize / 2 && speedX > 0) {
speedX = -speedX;
}
// Check for collision with barriers
for (var i = 0; i < barriers.length; i++) {
var barrier = barriers[i];
var dx = self.x - barrier.x;
var dy = self.y - barrier.y;
var distance = Math.sqrt(dx * dx + dy * dy);
- var minDist = self.width / 2 + barrier.width / 2;
+ var minDist = bubbleSize / 2 + barrier.width / 2;
if (distance < minDist) {
// Calculate the angle of the collision
var angle = Math.atan2(dy, dx);
// Calculate the new speed based on the angle of collision, treating the barrier as a static billiard ball
@@ -98,9 +106,9 @@
var row = [];
var rowWidth = rowCount % 2 == 0 ? 13 : 12;
for (var a = 0; a < rowWidth; a++) {
var bubble = new Bubble(getMaxTypes());
- bubble.setPos((2048 - bubble.width * rowWidth) / 2 + bubble.width * a + bubble.width / 2, -rowCount * (1.7320508076 * bubble.height) / 2);
+ bubble.setPos((2048 - bubbleSize * rowWidth) / 2 + bubbleSize * a + bubbleSize / 2, -rowCount * (1.7320508076 * bubbleSize) / 2);
self.container.addChild(bubble);
row.push(bubble);
/*bubble.down = function () {
var bubbles = self.getConnectedBubbles(this);
@@ -232,9 +240,9 @@
}
var dx = nextX - bubble.x - self.x;
var dy = nextY - bubble.y - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance < (bubble.width - 50) / 2 + bubble.width / 2) {
+ if (distance < (bubbleSize - 50) / 2 + bubbleSize / 2) {
return bubble;
}
}
}
@@ -298,34 +306,34 @@
gameIsStarted = true;
var intersectedBubblePos = self.findBubbleIndex(intersectedBubble);
var colOffset = rows[intersectedBubblePos.row].length == 13 ? 0 : 1;
var offsetPositions = [{
- x: intersectedBubble.x - intersectedBubble.width / 2,
- y: intersectedBubble.y - 1.7320508076 * intersectedBubble.height / 2,
+ x: intersectedBubble.x - bubbleSize / 2,
+ y: intersectedBubble.y - 1.7320508076 * bubbleSize / 2,
ro: intersectedBubblePos.row + 1,
co: intersectedBubblePos.col - 1 + colOffset
}, {
- x: intersectedBubble.x + intersectedBubble.width / 2,
- y: intersectedBubble.y - 1.7320508076 * intersectedBubble.height / 2,
+ x: intersectedBubble.x + bubbleSize / 2,
+ y: intersectedBubble.y - 1.7320508076 * bubbleSize / 2,
ro: intersectedBubblePos.row + 1,
co: intersectedBubblePos.col + colOffset
}, {
- x: intersectedBubble.x + intersectedBubble.width,
+ x: intersectedBubble.x + bubbleSize,
y: intersectedBubble.y,
ro: intersectedBubblePos.row,
co: intersectedBubblePos.col + 1
}, {
- x: intersectedBubble.x + intersectedBubble.width / 2,
- y: intersectedBubble.y + 1.7320508076 * intersectedBubble.height / 2,
+ x: intersectedBubble.x + bubbleSize / 2,
+ y: intersectedBubble.y + 1.7320508076 * bubbleSize / 2,
ro: intersectedBubblePos.row - 1,
co: intersectedBubblePos.col + colOffset
}, {
- x: intersectedBubble.x - intersectedBubble.width / 2,
- y: intersectedBubble.y + 1.7320508076 * intersectedBubble.height / 2,
+ x: intersectedBubble.x - bubbleSize / 2,
+ y: intersectedBubble.y + 1.7320508076 * bubbleSize / 2,
ro: intersectedBubblePos.row - 1,
co: intersectedBubblePos.col - 1 + colOffset
}, {
- x: intersectedBubble.x - intersectedBubble.width,
+ x: intersectedBubble.x - bubbleSize,
y: intersectedBubble.y,
ro: intersectedBubblePos.row,
co: intersectedBubblePos.col - 1
}];
@@ -443,11 +451,22 @@
});
var Launcher = Container.expand(function () {
var self = Container.call(this);
var bubble = self.addChild(new Bubble(getMaxTypes()));
+ var previewBubble;
+ function createPreviewBubble() {
+ previewBubble = self.addChild(new Bubble(getMaxTypes()));
+ previewBubble.scale.set(.5, .5);
+ previewBubble.x = -80;
+ previewBubble.y = 40;
+ }
+ createPreviewBubble();
self.fire = function () {
grid.fireBubble(bubble, self.angle);
- bubble = self.addChild(new Bubble(getMaxTypes()));
+ bubble = previewBubble;
+ previewBubble.x = previewBubble.y = 0;
+ previewBubble.scale.set(1, 1);
+ createPreviewBubble();
};
self.angle = -Math.PI / 2;
});
var ScoreIndicatorLabel = Container.expand(function (score, type) {
@@ -513,10 +532,11 @@
[ ] Make preview line fade out at the end
[ ] Add preview bubble
[ ]
*/
+var bubbleSize = 150;
var gameIsStarted = false;
-var bubbleColors = [0xdc5050, 0xfffb3c, 0x4eacff, 0x7436ff, 0xffb230, 0x8ed731];
+var bubbleColors = [0xff3c63, 0x8ed731, 0x4eacff, 0x7436ff, 0xffb230, 0xfffb3c];
var barriers = [];
var maxTypes = 5;
for (var a = 0; a < 4; a++) {
for (var b = 0; b < 3; b++) {
@@ -566,9 +586,9 @@
refreshHintLine();
// }
};
function getMaxTypes() {
- return Math.max(Math.min(Math.floor(LK.getScore() / 1000), bubbleColors.length), 3);
+ return Math.max(Math.min(Math.floor(LK.getScore() / 10000), bubbleColors.length), 3);
}
function refreshHintLine() {
var ox = hintTargetX - launcher.x;
var oy = hintTargetY - launcher.y;
Circular white gradient circle on black background. Gradient from white on the center to black on the outer edge all around.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Soft straight Long red paint on black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Fire ball. Bubble shooter game. Thin black outline.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
green notification bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.