Initial prompt
Bubble Shooter
Code edit (4 edits merged)
Please save this source code
User prompt
Add a bubble lesson to the bubble class.
Code edit (1 edits merged)
Please save this source code
User prompt
In the grid class set the X of the grid to half the width of the game
Code edit (17 edits merged)
Please save this source code
Code edit (25 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Write the getConnectedBubbles function for the grid. It should return the list of unique bubbles of the same type passed to the method such that you get a list of all connected bubbles. Note that the grid is hexagonal in nature, the method should handle that.
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();' Line Number: 50
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'var neighbors = self.getNeighbors(currentBubble);' Line Number: 56
User prompt
In the grid class, implement the getNeighbors method
Code edit (5 edits merged)
Please save this source code
User prompt
implement //Method that removes an array of bubbles from the rows array. self.removeBubbles = function (bubbels) {};
User prompt
In the method //Method that removes an array of bubbles from the rows array. self.removeBubbles = function (bubbles) { for (var i = 0; i < bubbles.length; i++) { var bubble = bubbles[i]; var bubbleIndex = this.findBubbleIndex(bubble); if (bubbleIndex) { rows[bubbleIndex.row].splice(bubbleIndex.col, 1); bubble.destroy(); } } }; The array indexes must be maintained. When removing a bubble from rows, the index should simply be set to null
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'self.removeBubbles(bubbels);' Line Number: 45
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'if (neighbor.type === bubble.type) {' Line Number: 74
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
===================================================================
--- original.js
+++ change.js
@@ -6,11 +6,8 @@
var bubbleGraphics = self.attachAsset('bubble', {
anchorX: 0.5,
anchorY: 0.5
});
- self.update = function () {
- self.y += self.speed;
- };
});
var Grid = Container.expand(function () {
var self = Container.call(this);
});
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.