Code edit (1 edits merged)
Please save this source code
User prompt
in findAvailablePositionAroundRefinery, take other buildings into account
User prompt
when an Harvester is spawned on the Refinery, order it to move to the first available place around the refinery
User prompt
when a Spice Refinery is placed, automatically spawn an Harvester on it
User prompt
in spawnUnit use the playerId instead of always calling player1.addUnit()
User prompt
Fix Bug: 'Timeout.tick error: eval is not a function' in or related to this line: 'var unitClass = eval(unitInfo.className);' Line Number: 752
User prompt
in spawnUnit, user the unitInfo.className instead of calling UnitHarvester constructor
User prompt
extract the code : ``` var harvesterUnitInfo = unitRepository.getUnitInfo('unitHarvester'); var newHarvester = new UnitHarvester(rockIlot1Center.x, rockIlot1Center.y - 2, player1.playerId); gameMap.cells[rockIlot1Center.x][rockIlot1Center.y - 2].unit = newHarvester; player1.addUnit(newHarvester); game.addChild(newHarvester); ``` in a new global function spawnUnit() with all the required parameters
Code edit (15 edits merged)
Please save this source code
User prompt
update findPath to avoid buildings
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
add the fps update
Code edit (3 edits merged)
Please save this source code
User prompt
display the fps in the bottom right in black
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
in handleDrag ensure that self.currentViewCenter x & y are always integers and not floats
User prompt
in handleDrag, update the self.currentViewCenter gradually,
User prompt
in handleDrag, update the self.currentViewCenter gradually, but don't use floats in self.currentViewCenter x & y
User prompt
in handleDrag, update the self.currentViewCenter gradually, but ensure self.currentViewCenter x & y are integers, not floats !
User prompt
in handleDrag, update the self.currentViewCenter gradually
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'building')' in or related to this line: 'if (!cell.building && !cell.unit && deltaToSelection > 1) {' Line Number: 1009
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '22.87842334540943')' in or related to this line: 'var cell = gameMap.cells[cellX][cellY];' Line Number: 1008
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '20')' in or related to this line: 'var cell = gameMap.cells[cellX][cellY];' Line Number: 1008
===================================================================
--- original.js
+++ change.js
@@ -219,10 +219,10 @@
self.handleDrag = function (input) {
// Clamp the view center to the map boundaries
var targetX = Math.max(14, Math.min(self.currentViewCenter.x + input.x, mapXSize - 7));
var targetY = Math.max(14, Math.min(self.currentViewCenter.y + input.y, mapYSize - 9));
- self.currentViewCenter.x = Math.round(self.currentViewCenter.x + (targetX - self.currentViewCenter.x) * 0.1);
- self.currentViewCenter.y = Math.round(self.currentViewCenter.y + (targetY - self.currentViewCenter.y) * 0.1);
+ self.currentViewCenter.x = Math.round(self.currentViewCenter.x + (targetX - self.currentViewCenter.x) * 0.5);
+ self.currentViewCenter.y = Math.round(self.currentViewCenter.y + (targetY - self.currentViewCenter.y) * 0.5);
console.log("handling drag...", input, self.currentViewCenter.x, self.currentViewCenter.y);
// Update the Text2 object with the new coordinates
self.viewCenterText.setText(self.currentViewCenter.x + ', ' + self.currentViewCenter.y);
//selectionMarker.setOnElement(currentSelection);
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