Code edit (1 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: screenCoordsToWorldCell is not defined' in or related to this line: 'var cellElt = screenCoordsToWorldCell(element.x, element.y);' Line Number: 645
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: getScreenToWorldCoord is not defined' in or related to this line: 'var wCoordCoords = getScreenToWorldCoord(x, y);' Line Number: 1657
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: getScreenToWorldCell is not defined' in or related to this line: 'var wCellCoords = getScreenToWorldCell(x, y);' Line Number: 1650
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
update the Map.render function to use the viewPort and world coordinates
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: 'Map.viewCenterText.setText(Map.currentViewCenter.x + ', ' + Map.currentViewCenter.y);' Line Number: 1619
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: newCoords is not defined' in or related to this line: 'game.mouseCoordsText.setText("S:" + Math.floor(x) + ',' + Math.floor(y) + '\r\n' + newCoords.wCellX + ',' + newCoords.wCellY + '\r\nW:' + wCellCoords.wCellX + ',' + wCellCoords.wCellY + '\r\n' + wCoordCoords.wX + ',' + wCoordCoords.wY);' Line Number: 1615
Code edit (2 edits merged)
Please save this source code
User prompt
in findAvailablePositionAroundRefinery, return relative values, instead of aboslute cell coordinates
Code edit (1 edits merged)
Please save this source code
User prompt
For a move from [9,11 to 8,11 find Path returned a path [{8,11}], instead of [{-1,0}]. Fix that
User prompt
now that findPath returns relative values, update the instruction var targetCell = { cellX: targetPathStep.x, cellY: targetPathStep.y }; in Unit.updateMovement accordingly
User prompt
in Map.findPath(), instead of returning and array of targetCells, return an array of relative moves. ie: instead of : [{cellX: 5, cellY: 5}, {cellX: 6, cellY: 5}, {cellX: 6, cellY: 6}] return : [{cellX: +1, cellY: 0}, {cellX: 0, cellY: +1}]
Code edit (16 edits merged)
Please save this source code
User prompt
in UnitHarvester, in update function, implement the case of spice unloading (self.harvestingMode == 2) In this mode, harvestedSpiceOnTripCounter is decremented by self.unloadSpeed. during this decrement, unit blinks in green. Each spice decremented is added to the player spice counter. When harvestedSpiceOnTripCounter reaches 0, the units starts a new harvesting cycle (self.startHarvesting()).
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -1478,8 +1478,16 @@
wCellX: wCellX,
wCellY: wCellY
};
};
+var getScreenToWorldCoord = function getScreenToWorldCoord(x, y) {
+ var wX = x + viewPort.wX * tileSize;
+ var wY = y + viewPort.wY * tileSize;
+ return {
+ wX: wX,
+ wY: wY
+ };
+};
var convertCoordsToCell = function convertCoordsToCell(x, y) {
return {
cellX: Math.floor(x / 100) + gameMap.currentViewCenter.x - Math.ceil(game.width / 2 / 100) - 3,
cellY: Math.floor(y / 100) + gameMap.currentViewCenter.y - Math.ceil(game.height / 2 / 100)
@@ -1627,9 +1635,9 @@
if (game.mouseCoordsText) {
game.mouseCoordsText.setText(Math.floor(x) + ',' + Math.floor(y) + '\r\n' + cellCoord.cellX + ',' + cellCoord.cellY);
}*/
var wCellCoords = getScreenToWorldCell(x, y);
- var wCoordCoords = screenCoordToWorldCoord(x, y);
+ var wCoordCoords = getScreenToWorldCoord(x, y);
if (game.mouseCoordsText) {
game.mouseCoordsText.setText("S:" + Math.floor(x) + ',' + Math.floor(y) + '\r\n' + Math.floor(x / tileSize) + ',' + Math.floor(y / tileSize) + '\r\nW:' + Math.floor(wCellCoords.wCellX) + ',' + Math.floor(wCellCoords.wCellY) + '\r\n' + Math.floor(wCoordCoords.wX) + ',' + Math.floor(wCoordCoords.wY));
}
gameMap.viewCenterText.setText(gameMap.currentViewCenter.x + ', ' + gameMap.currentViewCenter.y + '\r\n' + viewPort.wX + ',' + viewPort.wY);
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