Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: selectionMarker is not defined' in or related to this line: 'selectionMarker.hide();' Line Number: 319
User prompt
when a building is selected show the selectionCross at its center
User prompt
add a new building class called WindTrap ()
User prompt
add a new property to building to store what they can build
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: self.graphics.drawRect is not a function' in or related to this line: 'self.graphics.drawRect(0, 0, width, height);' Line Number: 27
User prompt
Fix Bug: 'Timeout.tick error: self.graphics.lineStyle is not a function' in or related to this line: 'self.graphics.lineStyle(4, 0xffd700, 1);' Line Number: 26
User prompt
Fix Bug: 'Timeout.tick error: Graphics is not a constructor' in or related to this line: 'self.graphics = new Graphics();' Line Number: 14
User prompt
is it possible to highlight currently selected element by adding a border ?
User prompt
is it possible to highlight currently selected element ?
Code edit (9 edits merged)
Please save this source code
User prompt
in updateActionBoard update currentSelectionText with currentSelection type or empty if currentSelection is null
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
add a new text 'currentSelectionText' at the top of the board
Code edit (1 edits merged)
Please save this source code
User prompt
in applyCellOccupation() copy the reference the building at gameMap.cells[cellX][cellY] to adjacent cells depending on building cellW and cellH
Code edit (2 edits merged)
Please save this source code
User prompt
Currently building creation is done like that : gameMap.cells[rockIlot1Center.x][rockIlot1Center.y].building = new ConstructionYard(rockIlot1Center.x, rockIlot1Center.y, 1); How to make this 2x2 buliding occupy 2x2 cells ?
Code edit (4 edits merged)
Please save this source code
User prompt
but I'm a developper and I don't see the variable, here is the function: self.render = function () { // Move tiles instead of the view var viewSize = Math.ceil(Math.max(game.width, game.height) / 2 / 100); // Calculate viewSize based on game dimensions and tile size for (var x = self.currentViewCenter.x - viewSize - 1; x <= self.currentViewCenter.x + viewSize; x++) { for (var y = self.currentViewCenter.y - viewSize - 1; y <= self.currentViewCenter.y + viewSize; y++) { if (x >= 0 && x < self.cells.length && y >= 0 && y < self.cells[x].length) { var cell = self.cells[x][y]; var asset = cell.asset; var screenX = (x - self.currentViewCenter.x + viewSize) * asset.width; var screenY = (y - self.currentViewCenter.y + viewSize) * asset.height; asset.x = screenX; asset.y = screenY; if (!asset.parent) { self.addChild(asset); } // Render buildings var building = cell.building; if (building) { building.asset.x = screenX; building.asset.y = screenY; self.addChild(building.asset); } } else { if (asset && asset.parent) { self.removeChild(asset); } } } } };
Code edit (6 edits merged)
Please save this source code
User prompt
Bulding should occupy cellW cells horizontally and cellH cells vertically, so when user clicks on a 2x2 building it should select the buiding when he clicks at at (x,y) (x+1,y), (x,y+1) and (x+1,y+1)
User prompt
when drawing a building at x,y, x,y should be the top left corner
===================================================================
--- original.js
+++ change.js
@@ -289,8 +289,9 @@
// Global function to handle action board updates
var updateActionBoard = function updateActionBoard() {
// Update logic for the action board
// This function can be called whenever the action board needs to be updated
+ console.log("updateActionBoard...", currentSelection);
};
function initGame() {
// Create players
player1 = new Player(1, 0xAAAAff);
a tileable sand terrain tile.
A square tileable rock terrain tile WITHOUT BBORDER. Single Game Texture. In-Game asset. 2d. No shadows. No Border
Zenith view of Dune's Wind Trap power facility square fence. Ressembles a bit to Sydney's Opera. Zenith view Directly from above.
grey cancel icon. UI
thin white circle empty.
0x5e86ff
Zenith view of a white rectangular Harvester shape of a garbage truck with a triangular head. Harvesting on sand, with flowing spice in the back. inside a square fence. Zenith view. Directly overhead. Plumb view.
Minimal Ui icon of an right sign aside with an icon of a target. sand background
Minimal icon of a home with direction icon pointing to the home. sand background
3 white flat isometric concentric circles like a target.
Remove background
Gray background
Minimal Ui icon of target sign on a fire icon.. sand background
top view of an explosion effect.
Simple heavy army tank factory buiding a tank with a crane. Square fence... Zenith view Directly overhead. Plumb view.
an empty black popup UI. UI