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
@@ -97,9 +97,9 @@
function insertRow() {
var row = [];
var rowWidth = rowCount % 2 == 0 ? 13 : 12;
for (var a = 0; a < rowWidth; a++) {
- var bubble = new Bubble();
+ var bubble = new Bubble(getMaxTypes());
bubble.setPos((2048 - bubble.width * rowWidth) / 2 + bubble.width * a + bubble.width / 2, -rowCount * (1.7320508076 * bubble.height) / 2);
self.container.addChild(bubble);
row.push(bubble);
/*bubble.down = function () {
@@ -294,8 +294,9 @@
nextX = Math.min(Math.max(nextX, 150 / 2), 2048 - 150 / 2);
}
var intersectedBubble = self.bubbleIntersectsGrid(nextX + self.x, nextY + self.y);
if (intersectedBubble) {
+ gameIsStarted = true;
var intersectedBubblePos = self.findBubbleIndex(intersectedBubble);
var colOffset = rows[intersectedBubblePos.row].length == 13 ? 0 : 1;
var offsetPositions = [{
x: intersectedBubble.x - intersectedBubble.width / 2,
@@ -397,25 +398,41 @@
bubblesInFlight.splice(a--, 1);
bubble.destroy();
}
}
- self.y += .5;
- var zeroRow = rows[0];
+ if (gameIsStarted) {
+ self.y += 5;
+ }
+ var zeroRow = rows[rows.length - 1];
if (zeroRow) {
for (var a = 0; a < zeroRow.length; a++) {
var bubble = zeroRow[a];
if (bubble) {
- if (bubble.y + self.y > 2000) {
+ if (bubble.y + self.y > -100) {
insertRow();
}
break;
}
}
} else {
insertRow();
}
+ var lastRow = rows[0];
+ if (lastRow) {
+ for (var a = 0; a < zeroRow.length; a++) {
+ var bubble = lastRow[a];
+ if (bubble) {
+ if (bubble.y + self.y > 2200) {
+ LK.effects.flashScreen(0xffffff, 1000, function () {
+ LK.showGameOver();
+ });
+ }
+ break;
+ }
+ }
+ }
};
- for (var a = 0; a < 5; a++) {
+ for (var a = 0; a < 8; a++) {
insertRow();
}
});
var HintBubble = Container.expand(function () {
@@ -426,12 +443,12 @@
});
});
var Launcher = Container.expand(function () {
var self = Container.call(this);
- var bubble = self.addChild(new Bubble(3));
+ var bubble = self.addChild(new Bubble(getMaxTypes()));
self.fire = function () {
grid.fireBubble(bubble, self.angle);
- bubble = self.addChild(new Bubble(3));
+ bubble = self.addChild(new Bubble(getMaxTypes()));
};
self.angle = -Math.PI / 2;
});
var ScoreIndicatorLabel = Container.expand(function (score, type) {
@@ -497,10 +514,12 @@
[ ] Make preview line fade out at the end
[ ] Add preview bubble
[ ]
*/
-var bubbleColors = [0xff0000, 0x00ff00, 0x0000ff, 0xff00ff, 0xffff00, 0x00ffff, 0xffffff];
+var gameIsStarted = false;
+var bubbleColors = [0xff0000, 0x00ff00, 0x0000ff, 0xff00ff, 0xffff00, 0x00ffff];
var barriers = [];
+var maxTypes = 5;
for (var a = 0; a < 4; a++) {
for (var b = 0; b < 3; b++) {
var barrier = game.addChild(new Barrier());
barrier.y = 2732 - 500 + b * 25;
@@ -528,9 +547,9 @@
game.addChild(sm);
}
var particlesLayer = game.addChild(new Container());
var grid = game.addChild(new Grid());
-grid.y = 1300;
+grid.y = 800;
var freeBubbleLayer = game.addChild(new Container());
var hintBubblePlayer = game.addChild(new Container());
var launcher = game.addChild(new Launcher());
launcher.x = game.width / 2;
@@ -547,8 +566,11 @@
hintTargetY = y;
refreshHintLine();
// }
};
+function getMaxTypes() {
+ return Math.max(Math.min(Math.floor(LK.getScore() / 1000), bubbleColors.length), 3);
+}
function refreshHintLine() {
var ox = hintTargetX - launcher.x;
var oy = hintTargetY - launcher.y;
var angle = Math.atan2(oy, ox);
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.