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 (3 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
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 = self.addChild(new Container()); var rowCount = 0; function insertRow() { var rowWidth = rowCount % 2 == 0 ? 13 : 12; for (var a = 0; a < rowWidth; a++) { var bubble = new Bubble(); bubble.x = (2048 - bubble.width * rowWidth) / 2 + bubble.width * a + bubble.width / 2; bubble.y = -rowCount * bubble.height; container.addChild(bubble); } rowCount++; } insertRow(); insertRow(); insertRow(); container.y = 2000; }); 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,41 @@
});
});
var Grid = Container.expand(function () {
var self = Container.call(this);
- grid.x = game.width / 2;
+ var bubbles = [];
+ var container = self.addChild(new Container());
+ var rowCount = 0;
+ function insertRow() {
+ var rowWidth = rowCount % 2 == 0 ? 13 : 12;
+ for (var a = 0; a < rowWidth; a++) {
+ var bubble = new Bubble();
+ bubble.x = (2048 - bubble.width * rowWidth) / 2 + bubble.width * a + bubble.width / 2;
+ bubble.y = -rowCount * bubble.height;
+ container.addChild(bubble);
+ }
+ rowCount++;
+ }
+ insertRow();
+ insertRow();
+ insertRow();
+ container.y = 2000;
});
+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.
green notification bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.