Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.col')' in or related to this line: 'var newCol = bubbleIndex.col + dir[1];' Line Number: 221
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'var newRow = bubbleIndex.row + dir[0];' Line Number: 218
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row] && rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: null is not an object (evaluating 'bubbleIndex.row')' in or related to this line: 'if (rows[bubbleIndex.row].length == 12) {' Line Number: 211
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: intersectedBubble' in or related to this line: 'var intersectedBubblePos = self.findBubbleIndex(intersectedBubble);' Line Number: 313
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: Can't find variable: isActive' in or related to this line: 'if (isActive) {' Line Number: 57
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
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
===================================================================
--- 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.