Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'self.label.y = self.asset.y + 50;' Line Number: 524
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'self.label.x = x - action.name.length / 2 * 13;' Line Number: 523
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'self.label.x = self.asset.x - action.name.length / 2 * 13;' Line Number: 523
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'on')' in or related to this line: 'self.asset.on('down', function () {' Line Number: 513
User prompt
add a new ActionRepository for units actions
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'self.asset = self.attachAsset(action.icon, {' Line Number: 478
Code edit (1 edits merged)
Please save this source code
User prompt
add an actions array in Unit calss
User prompt
implement displayActionItems with a logic similar to displayBuildableItems but for unit actions
Code edit (8 edits merged)
Please save this source code
User prompt
add a new global function displayActionItems()
User prompt
add a new class ActionItemIcon for units action/orders
User prompt
in unit repository add an array of possible actions for each unit
User prompt
when an unit is selected, enter in GIVING_ORDERS mode
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: unitRepository is not defined' in or related to this line: 'var unitInfo = unitRepository.getUnitInfo(type);' Line Number: 342
User prompt
in Unit class , set the name property using the UnitRepository
Code edit (1 edits merged)
Please save this source code
User prompt
in SelectionMarker define 2 assets : selectionCross and selectionCircle
User prompt
Fix Bug: 'Timeout.tick error: element is not defined' in or related to this line: 'if (element.isBuilding) {' Line Number: 210
User prompt
in SelectionMarker setOnElement, use asset selectionCross when element.isBuilding, and selectionCircle when element.isUnit
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -589,8 +589,9 @@
var gameIsRunning = false;
var mapXSize = 50;
var mapYSize = 30;
var gameMap = new Map();
+var unitRepository = new UnitRepository();
// Define user action states
var UserActionState = {
NAVIGATING: 'navigating',
BUILDING: 'building',
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