Code edit (1 edits merged)
Please save this source code
User prompt
In the grid class, implement the getNeighbors method
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'var neighbors = self.getNeighbors(currentBubble);' Line Number: 56
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'var visited = new Set();' Line Number: 50
Code edit (16 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
Code edit (1 edits merged)
Please save this source code
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 (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
Initial prompt
Bubble Shooter
/**** * Classes ****/ var Bubble = Container.expand(function () { var self = Container.call(this); var bubbleGraphics = self.attachAsset('bubble', { anchorX: 0.5, anchorY: 0.5 }); }); var Grid = Container.expand(function () { var self = Container.call(this); var bubbles = []; var container = new Container(); var isWideRow = false; function insertRow() { var rowWidth = isWideRow ? 13 : 12; for (var a = 0; a < rowWidth; a++) { var bubble = new Bubble(); bubble.x = (2048 - bubble.width * rowWidth) / 2 + bubble.width * a; self.addChild(bubble); } isWideRow = !isWideRow; } insertRow(); }); var HintBubble = Container.expand(function () { var self = Container.call(this); }); var Launcher = Container.expand(function () { var self = Container.call(this); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x010c42 }); /**** * Game Code ****/ //Game size 2048x2732 var grid = game.addChild(new Grid());
===================================================================
--- original.js
+++ change.js
@@ -9,18 +9,37 @@
});
});
var Grid = Container.expand(function () {
var self = Container.call(this);
- grid.x = game.width / 2;
+ var bubbles = [];
+ var container = new Container();
+ var isWideRow = false;
+ function insertRow() {
+ var rowWidth = isWideRow ? 13 : 12;
+ for (var a = 0; a < rowWidth; a++) {
+ var bubble = new Bubble();
+ bubble.x = (2048 - bubble.width * rowWidth) / 2 + bubble.width * a;
+ self.addChild(bubble);
+ }
+ isWideRow = !isWideRow;
+ }
+ insertRow();
});
+var HintBubble = Container.expand(function () {
+ var self = Container.call(this);
+});
+var Launcher = Container.expand(function () {
+ var self = Container.call(this);
+});
/****
* Initialize Game
****/
var game = new LK.Game({
- backgroundColor: 0x000000
+ backgroundColor: 0x010c42
});
/****
* Game Code
****/
+//Game size 2048x2732
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.