Code edit (8 edits merged)
Please save this source code
User prompt
building should move with the map as they are fixed objects
Code edit (1 edits merged)
Please save this source code
User prompt
fix still ConstructionYard aren't visibles
User prompt
still ConstructionYard aren't visibles
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'cells')' in or related to this line: 'gameMap.cells[rockIlot1Center.x][rockIlot1Center.y].building = new ConstructionYard(rockIlot1Center.x, rockIlot1Center.y);' Line Number: 186
User prompt
fix buildings assets not added to game
Code edit (1 edits merged)
Please save this source code
User prompt
instanciate a construction yard at the center of each rock ilot
User prompt
add the first building type : 'constructionYard'
User prompt
this is an RTS game. Now add the base class for buildings.
Code edit (2 edits merged)
Please save this source code
User prompt
adapt handleDragMove and handleInput to make them work together
Code edit (1 edits merged)
Please save this source code
User prompt
adapt the `handleDragMove` function to include a call to `gameMap.handleInput`. This would involve passing the current input position to the `handleInput` method of the `gameMap` object.
User prompt
use the gameMap.handleInput with the new drag system to keep the rules
Code edit (1 edits merged)
Please save this source code
User prompt
update game.on('down', startViewMovement); game.on('up', stopViewMovement); to make a drag system
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: isPressing is not defined' in or related to this line: 'if (isPressing && gameMap.lastInputPosition) {' Line Number: 213
User prompt
switch to a drag system
User prompt
Fix Bug: 'TypeError: Cannot read properties of null (reading 'x')' in or related to this line: 'var deltaX = input.x - self.lastInputPosition.x;' Line Number: 75
User prompt
Still not good on mobile. Th view should follow the 'drag' movement of the user finger
User prompt
fix pressing system as you said : // Since 'tick' does not provide an event object, we cannot call 'handleContinuousMovement' // Instead, we should handle the continuous movement logic here if needed
===================================================================
--- original.js
+++ change.js
@@ -126,11 +126,13 @@
self.x = x * 100;
self.y = y * 100;
self.type = type;
self.asset = self.attachAsset(type, {
- x: self.x,
- y: self.y
+ anchorX: 0.5,
+ anchorY: 0.5
});
+ self.asset.x = self.x;
+ self.asset.y = self.y;
// Initialize building-specific properties here
// ...
return self;
});
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