User prompt
reduce the alpha of lines
Code edit (1 edits merged)
Please save this source code
User prompt
add horizontal and vertical lines between dots
User prompt
add an asset for lines between dots
Code edit (2 edits merged)
Please save this source code
User prompt
add two icons that will represent the 2 players on the top
Code edit (1 edits merged)
Please save this source code
User prompt
add more space between dots
User prompt
center the board in the screen
User prompt
the board should be 7x7
Initial prompt
Xmas Dots and Boxes
var Line = Container.expand(function () { var self = Container.call(this); var lineGraphics = self.createAsset('line', 'Line Graphics', 0, 0.5); self.setLength = function (length) { lineGraphics.width = length; }; return self; }); var Dot = Container.expand(function () { var self = Container.call(this); var dotGraphics = self.createAsset('dot', 'Dot Graphics', .5, .5); self.connect = function () {}; }); var Square = Container.expand(function () { var self = Container.call(this); var squareGraphics = self.createAsset('square', 'Square Graphics', .5, .5); self.collectGift = function () {}; }); var PlayerIcon = Container.expand(function (playerNumber) { var self = Container.call(this); var iconAsset = playerNumber === 1 ? 'player1Icon' : 'player2Icon'; var playerIconGraphics = self.createAsset(iconAsset, 'Player ' + playerNumber + ' Icon', 0.5, 0.5); return self; }); var Game = Container.expand(function () { var self = Container.call(this); var player1Icon = self.addChild(new PlayerIcon(1)); player1Icon.x = 2048 * 0.25; player1Icon.y = 200; var player2Icon = self.addChild(new PlayerIcon(2)); player2Icon.x = 2048 * 0.75; player2Icon.y = 200; var dots = []; var squares = []; var gifts = 0; var boardSize = 6 * 300; var offsetX = (2048 - boardSize) / 2; var offsetY = (2732 - boardSize) / 2 + 150; for (var i = 0; i < 7; i++) { for (var j = 0; j < 7; j++) { var dot = new Dot(); dot.x = offsetX + i * 300; dot.y = offsetY + j * 300; dots.push(dot); self.addChild(dot); } } dots.forEach(function (dot) { dot.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); }); }); LK.on('tick', function () { squares.forEach(function (square) { if (square.isComplete()) { gifts++; square.collectGift(); } }); }); });
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,12 @@
+var Line = Container.expand(function () {
+ var self = Container.call(this);
+ var lineGraphics = self.createAsset('line', 'Line Graphics', 0, 0.5);
+ self.setLength = function (length) {
+ lineGraphics.width = length;
+ };
+ return self;
+});
var Dot = Container.expand(function () {
var self = Container.call(this);
var dotGraphics = self.createAsset('dot', 'Dot Graphics', .5, .5);
self.connect = function () {};
a b&w grinch icon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
b&w smiling Santa Clauss' head icon Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white christmas star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
top face of a white gift. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.