User prompt
Write the moveTowardsHomePosition method that moves the blocks toward their starting position
Code edit (4 edits merged)
Please save this source code
User prompt
Write the code in moveHome on block that animates the block back to it's starting position
Code edit (17 edits merged)
Please save this source code
User prompt
When you stop dragging a tile return it to it's start position
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
When creating cells in board make sure the cells are put into the right position in this.grid
User prompt
Fix Bug: 'ReferenceError: Can't find variable: startY' in this line: 'var cell = board.grid && board.grid[startY + i] && board.grid[startY + i][startX + j];' Line Number: 59
User prompt
rather than referring to self.parent.grid refer to board.grid
User prompt
In block remove the shape argument and replace it with a board agument
User prompt
when creating a block pass along the board instance to the creator
User prompt
Make sure blocks is initialized as a 10x10 grid
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.grid[startY + i]')' in this line: 'var cell = self.parent.grid[startY + i] && self.parent.grid[startY + i][startX + j];' Line Number: 75
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'self.parent.grid[startY + i]')' in this line: 'var cell = self.parent.grid[startY + i] && self.parent.grid[startY + i][startX + j];' Line Number: 75
User prompt
When dragging a block above the board, calculate which block blocks overlap cells in the board. And set those sell colors to red by tinting them red
User prompt
When dragging a block above the board, calculate which block blocks overlap cells in the board. And set those sell colors to red by tinting them red
User prompt
Board should be created before blocks are created
User prompt
Add logic that allows me to drag and drop the blocks crated in Game
User prompt
set alpha on the block background asset to .5
User prompt
In Game, create a method that creates a new block and use that instead when creating blocks
User prompt
Fix Bug: 'TypeError: undefined is not an object (evaluating 'block.dragData.getLocalPosition')' in this line: 'block.dragOffsetX = block.dragData.getLocalPosition(block.parent).x - block.x;' Line Number: 76
User prompt
Allow me to drag and drop the blocks created in GAme
===================================================================
--- original.js
+++ change.js
@@ -35,9 +35,24 @@
self.addChild(block);
}
}
}
- self.move = function () {};
+ self.move = function (x, y) {
+ self.x = x;
+ self.y = y;
+ };
+ self.on('down', function (obj) {
+ self.dragging = true;
+ });
+ stage.on('move', function (obj) {
+ if (self.dragging) {
+ var pos = obj.event.getLocalPosition(self.parent);
+ self.move(pos.x, pos.y);
+ }
+ });
+ stage.on('up', function (obj) {
+ self.dragging = false;
+ });
self.rotateShapeRandomly = function () {
var rotations = Math.floor(Math.random() * 4);
for (var r = 0; r < rotations; r++) {
self.shape = self.shape[0].map((val, index) => self.shape.map(row => row[index]).reverse());
White square with round corners, flat shaded, hyper casual game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White square with tight round corners, flat shaded, hyper casual game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Background for relaxing puzzle game. Pastel colors, flat shaded, vector art. Flowers. Blocks. Relaxing. Clouds Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White particle cloud. Cartoon. Bright outline. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.