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
@@ -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.