Code edit (3 edits merged)
Please save this source code
User prompt
add a console log when the harvestedSpiceCounter updates
User prompt
implament the harvester 'harvest' action : move to the closest spice spot, switch to harvesting Mode, and increment a harvestedSpiceCounter from 0 to 200 per spot
Code edit (10 edits merged)
Please save this source code
User prompt
in Map.render, , use cell.spiceAsset instead of creating a new terrainSpice
User prompt
in initSpiceSpots(), fill the cell.spiceAsset properties
User prompt
add a new property to cells 'spiceAsset' and set it to null in Map.init()
Code edit (1 edits merged)
Please save this source code
User prompt
At the beginning of render function, clear the screen
Code edit (1 edits merged)
Please save this source code
User prompt
In map render if spice = true for cell then add a terrainSpice on it
User prompt
In initSpiceSpots after the spice creation loop add a new property spice = true to gameMap cells based on globalTerrain values
User prompt
Spice spots are all the cells containing spice. They will be listed in spiceSpots global array. Implement initSpiceSpots to add 4 random ilots of spice on sand cells in each quarter of the map
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -142,8 +142,9 @@
});
// Position the text at the top center of the screen
LK.gui.top.addChild(self.viewCenterText);
self.render = function () {
+ self.removeChildren();
// Move tiles instead of the view
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) {
@@ -161,9 +162,9 @@
var spiceAsset = LK.getAsset('terrainSpice', {
x: screenX,
y: screenY
});
- //if (!spiceAsset.parent)
+ //if (!spiceAsset.parent)
{
self.addChild(spiceAsset);
}
}
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