Code edit (4 edits merged)
Please save this source code
User prompt
Write this method //Method that gets all bubbles which are not, or do not have a recursive neighbour that is connected to the top row of bubblels self.getDetachedBubbles = function () {};
Code edit (5 edits merged)
Please save this source code
User prompt
Implement this //Get a list of bubbles that are not connected to the top row, or to a chain of bubbles connected to the top row. self.getDetachedBubbles = function () {}; Note that all unconnected bubbles must be detected
Code edit (1 edits merged)
Please save this source code
User prompt
getDetachedBubbles does not seem to detect all unconnected bubbles, please fix this
User prompt
Implement this //Get a list of bubbles that are not connected to the top row, or to a chain of bubbles connected to the top row. self.getDetachedBubbles = function () {}; Note that all unconnected bubbles must be detected
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'var visited = new Set(connectedToTop);' Line Number: 98
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'return bubble !== undefined;' Line Number: 99
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'return bubble !== null;' Line Number: 99
User prompt
In var visited = new Set(connectedToTop.filter(function (bubble) { return bubble != null; })); LK does not support Set, please fix this
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'if (bubble !== null && !visited.has(bubble)) {' Line Number: 105
Code edit (5 edits merged)
Please save this source code
User prompt
in getDetachedBubbles you are using getConnectedBubbles however that is type dependent, for this case any type should count as connected.
Code edit (5 edits merged)
Please save this source code
User prompt
rewrite getDetachedBubbles such that it counts from the last element in rows not the first
Code edit (18 edits merged)
Please save this source code
Code edit (25 edits merged)
Please save this source code
Code edit (25 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
in bubble update, if not attached, if a bubble intersects with a barrier and the bubble is moving towards the barrier. Bounce the bubble off the barrier
Code edit (3 edits merged)
Please save this source code
User prompt
in bible update, update the intersection logic to assume the barriers is a rectangle and the balls is a circle
User prompt
the modification of speedX and speedY should be based on rectangle to circle intersection and the out angle after intersection should be calculated accordingly
===================================================================
--- original.js
+++ change.js
@@ -72,21 +72,10 @@
}
}
return connectedBubbles;
};
- //Method that gets all bubbles which are not, or do not have a recursive neighbour that is connected to the top row of bubblels
- self.getDetachedBubbles = function () {
- var detachedBubbles = [];
- for (var row = 0; row < rows.length; row++) {
- for (var col = 0; col < rows[row].length; col++) {
- var bubble = rows[row][col];
- if (bubble && !self.isConnectedToTop(bubble)) {
- detachedBubbles.push(bubble);
- }
- }
- }
- return detachedBubbles;
- };
+ //Get a list of bubbles that are not connected to the top row, or to a chain of bubbles connected to the top row.
+ self.getDetachedBubbles = function () {};
self.getNeighbors = function (bubble) {
var neighbors = [];
var bubbleIndex = this.findBubbleIndex(bubble);
var directions = [[-1, 0], [1, 0],
@@ -150,27 +139,5 @@
/****
* Game Code
****/
//Game size 2048x2732
-var grid = game.addChild(new Grid());
-self.isConnectedToTop = function (bubble) {
- var queue = [bubble];
- var visited = [];
- while (queue.length > 0) {
- var currentBubble = queue.shift();
- if (visited.indexOf(currentBubble) === -1) {
- visited.push(currentBubble);
- var bubbleIndex = self.findBubbleIndex(currentBubble);
- if (bubbleIndex.row === 0) {
- return true;
- }
- var neighbors = self.getNeighbors(currentBubble);
- for (var i = 0; i < neighbors.length; i++) {
- var neighbor = neighbors[i];
- if (neighbor) {
- queue.push(neighbor);
- }
- }
- }
- }
- return false;
-};
\ No newline at end of file
+var grid = game.addChild(new Grid());
\ No newline at end of file
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.