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
@@ -280,14 +280,16 @@
angle: angle
});
};
self.update = function () {
- for (var rep = 0; rep < 15; rep++) {
- for (var a = 0; a < bubblesInFlight.length; a++) {
- var current = bubblesInFlight[a];
- var bubble = current.bubble;
- var nextX = bubble.x + Math.cos(current.angle) * 4;
- var nextY = bubble.y + Math.sin(current.angle) * 4;
+ outer: for (var a = 0; a < bubblesInFlight.length; a++) {
+ var current = bubblesInFlight[a];
+ var bubble = current.bubble;
+ var nextX = bubble.x;
+ var nextY = bubble.y;
+ for (var rep = 0; rep < 25; rep++) {
+ nextX += Math.cos(current.angle) * 4;
+ nextY += Math.sin(current.angle) * 4;
if (nextX < 150 / 2 || nextX > 2048 - 150 / 2) {
current.angle = Math.PI - current.angle; // Reflect angle
nextX = Math.min(Math.max(nextX, 150 / 2), 2048 - 150 / 2);
}
@@ -366,9 +368,9 @@
row = [null, null, null, null, null, null, null, null, null, null, null, null, null];
}
rows.unshift(row);
}
- console.log(offsetPositions[closestPosition].co);
+ //console.log(offsetPositions[closestPosition].co);
row[offsetPositions[closestPosition].co] = bubble;
bubblesInFlight.splice(a--, 1);
refreshHintLine();
var bubbles = self.getConnectedBubbles(bubble);
@@ -383,27 +385,39 @@
})) {
rows.splice(row, 1);
}
}
- self.printRowsToConsole();
- } else {
- bubble.x = nextX;
- bubble.y = nextY;
+ //self.printRowsToConsole();
+ continue outer;
}
}
+ bubble.x = nextX;
+ bubble.y = nextY;
+ if (bubble.y + self.y < -1000) {
+ //Destory bubbles that somehow manages to escape at the top
+ bubblesInFlight.splice(a--, 1);
+ bubble.destroy();
+ }
}
+ self.y += .5;
+ var zeroRow = rows[0];
+ if (zeroRow) {
+ for (var a = 0; a < zeroRow.length; a++) {
+ var bubble = zeroRow[a];
+ if (bubble) {
+ if (bubble.y + self.y > 2000) {
+ insertRow();
+ }
+ break;
+ }
+ }
+ } else {
+ insertRow();
+ }
};
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
- insertRow();
+ for (var a = 0; a < 5; a++) {
+ insertRow();
+ }
});
var HintBubble = Container.expand(function () {
var self = Container.call(this);
var bubble = self.attachAsset('hintbubble', {
@@ -542,10 +556,10 @@
isValid = angle < -.2 && angle > -Math.PI + .2;
if (isValid) {
path = grid.calculatePath(launcher, angle);
//This allows updated faster than 60fps, making everyting feel better.
- renderHintBubbels();
}
+ renderHintBubbels();
}
var hintOffset = 0;
var distanceBetweenHintbubbles = 100;
function renderHintBubbels() {
@@ -594,9 +608,9 @@
bubbleAlpha = Math.min(bubbleAlpha + .05, 1);
} else {
bubbleAlpha = Math.max(bubbleAlpha - .05, 0);
}
- renderHintBubbels();
+ refreshHintLine();
};
game.up = function () {
if (isValid) {
launcher.fire();
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.