Code edit (6 edits merged)
Please save this source code
User prompt
in handleDragEnd, don't select buildings if they are under fog
User prompt
don't select ennemy units and building if they are under fog
User prompt
in updateFogOfWar remove the fog in a radius shape instead of a square
Code edit (2 edits merged)
Please save this source code
User prompt
in building growExplosion, remove building from player list of buildings
User prompt
in checkGameEnd, check if player1 of player2 have no more buildings game over if so
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
call updateFogOfWar(); after every building placement
Code edit (7 edits merged)
Please save this source code
User prompt
in updateFogOfWar, itterate through all player1 units and buildings and set gameMap.cells[x][y].fog to false 5 cells around them
User prompt
force fogOfWar tint to 0x000000
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
in harvester update, when self.harvestingMode == 3, add spice to the unit player not always to player1
Code edit (1 edits merged)
Please save this source code
Code edit (20 edits merged)
Please save this source code
User prompt
in unitharvester stopOtherActions, user unit player tint instead of 0xFFFFFF
User prompt
implent fog of war
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Update the findPath A* algorithm to take into account the range when openSet.length === 0
User prompt
Update the findPath A* algorithm to take into account the range
Code edit (5 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -2146,9 +2146,12 @@
console.log('Invalid cell for building placement.');
return;
}
var cell = gameMap.cells[cellX][cellY];
- if (cell.building && (!cell.fog || cell.building.playerId === player1.playerId)) {
+ if (cell.building && cell.fog) {
+ console.log('Building is under fog and cannot be selected.');
+ return;
+ } else if (cell.building) {
console.log('Cell is already occupied.');
return;
}
// Place the building on the map
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