User prompt
check when moving Zbert that when button released he is on a tile. If not then move Zbert back behind grid and apply gravity
Code edit (3 edits merged)
Please save this source code
User prompt
Add alpha to control buttons
User prompt
when detecting the tile Zbert is on, pick the tile directly below Zbert
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: tileColorCounter.updateCounts is not a function' in or related to this line: 'tileColorCounter.updateCounts(tileColorCounter.whiteCount, tileColorCounter.greenCount);' Line Number: 117
User prompt
Fix Bug: 'Uncaught ReferenceError: tileColorCounter is not defined' in or related to this line: 'tileColorCounter.whiteCount++;' Line Number: 107
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: initializeTileColorCounter is not defined' in or related to this line: 'initializeTileColorCounter();' Line Number: 218
User prompt
remove tile colour counter from game
User prompt
when Zbert moves from one tile to the next detect where Zbert is and flip tile that Zbert interacts with
Code edit (7 edits merged)
Please save this source code
User prompt
When controlbuttons are pressed, tint buttons orange. remove tint when buttons are released
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
Set rotation point of control buttons to centre point of asset
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
turn CCupL, CCupR, CCdownL and CCdownR in to buttons that control Zbert.
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
add rotation of +90 degrees to counterCorner
User prompt
add rotation of -45degrees to cornerCounter
Code edit (2 edits merged)
Please save this source code
User prompt
on countercorner add x and y cordinates so position can manually be set
===================================================================
--- original.js
+++ change.js
@@ -15,9 +15,9 @@
alpha: 0.5
});
self.controlDirection = controlDirection;
self.on('down', function (obj) {
- buttonGraphics.tint = 0xFFA500; // Tint button orange
+ buttonGraphics.tint = 0x000000; // Tint button orange
var zbert = game.grid.children.find(function (child) {
return child instanceof Zbert;
});
if (zbert) {
@@ -49,14 +49,23 @@
moveX = tileWidth / 2;
moveY = tileHeight - 90;
break;
}
- self.x += moveX;
- self.y += moveY;
- // Detect the tile Zbert is moving to and flip its color
- var tileBelow = game.grid.getTileAt(self.x, self.y + tileHeight);
+ var potentialX = self.x + moveX;
+ var potentialY = self.y + moveY;
+ // Check if the potential position is on a tile
+ var tileBelow = game.grid.getTileAt(potentialX, potentialY + tileHeight / 2);
if (tileBelow) {
+ self.x = potentialX;
+ self.y = potentialY;
tileBelow.flipColor();
+ } else {
+ // Apply gravity and move Zbert behind the grid
+ self.y += 5;
+ if (self.y > game.grid.y + game.grid.gridSize * tileHeight) {
+ self.x = game.grid.x - self.width;
+ self.y = game.grid.y + game.grid.gridSize * tileHeight / 2;
+ }
}
};
var zbertGraphics = self.attachAsset('Zbert1', {
anchorX: 0.5,
beautiful landscape. starry sky, pastel colours, high definition, alien world. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful expansive landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful expansive landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A little cube person. 2 legs. back to viewer. facing 45 degrees to the right. multicoloured skin, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white circle. metallic. light bevel on edge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Round furry, cute alien ball with big eyes. vivid colours, looking at 45 degrees to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bright 3d present with bow, vivd colours. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Change to be vivid multicoloured cube
A simple Triangle, flat shaded, bevelled edges. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Speech bubble with expletive word in it. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
parachute. multicoloured. cartoon style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white circle with a single thin black border. flat shade. simple graphic. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
small star shape, vivid metallic blue, varying length spikes on star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.