Code edit (4 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: cellX is not defined' in or related to this line: 'building = new SpiceRefinery(cellX, cellY, player1.playerId);' Line Number: 387
Code edit (3 edits merged)
Please save this source code
User prompt
in ConstructionYard constructor retreive buildables from the BuildableRepository
Code edit (5 edits merged)
Please save this source code
User prompt
add all required code for a new building : spiceRefinery:{ 'name': 'Wind Trap', 'cost': 600, 'energy': -50, 'constructionTime': 4, 'className': 'SpiceRefinery', 'buildable': [] }
Code edit (1 edits merged)
Please save this source code
User prompt
in updateBaseInfo, also animate the energy color : red near 0%, orange around 50% and #037d50 near 100%
User prompt
in updateEnergy, clamp the energy between 0 and 100
Code edit (4 edits merged)
Please save this source code
User prompt
in updateBaseInfo, keep track of the previous energyLevel in a global variable and use it to animate the change of the energy value
User prompt
in enqueueBuildable, don't reduce spice by buildableInfo.cost directly, instead reduce it progressively during the building progress
Code edit (1 edits merged)
Please save this source code
User prompt
call addBuilding when a buiding is added in handleBuildingPlacement
User prompt
in updateEnergy, use buildings instead of gameMap
Code edit (1 edits merged)
Please save this source code
User prompt
in displayBuildableItems , only display BuildableItemIcons if currentSelection is the property of player 1
Code edit (5 edits merged)
Please save this source code
User prompt
do the same for player2
User prompt
call addBuilding() after the creation of the initial Construction Yard
User prompt
add a function 'addBuilding()' to Player class
User prompt
add an array property in Player to store all the player's buildings
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
in updateBaseInfo, also update player1EnergyText
===================================================================
--- original.js
+++ change.js
@@ -397,9 +397,9 @@
console.log("Not buildables...");
return;
}
var buildableItems = currentSelection.buildable;*/
- if (currentSelection && currentSelection.buildable && currentSelection.buildable.length) {
+ if (currentSelection && currentSelection.playerId === player1.playerId && currentSelection.buildable && currentSelection.buildable.length) {
var iconX = commandPanel.x + 200; // Starting X position for the first icon
var iconY = commandPanel.y + 200; // Y position for all icons
currentSelection.buildable.forEach(function (itemType) {
var icon = new BuildableItemIcon(itemType, iconX, iconY);
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