Code edit (7 edits merged)
Please save this source code
User prompt
in handleDrag ensure that self.currentViewCenter x & y are always integers and not floats
User prompt
in handleDrag, update the self.currentViewCenter gradually,
User prompt
in handleDrag, update the self.currentViewCenter gradually, but don't use floats in self.currentViewCenter x & y
User prompt
in handleDrag, update the self.currentViewCenter gradually, but ensure self.currentViewCenter x & y are integers, not floats !
User prompt
in handleDrag, update the self.currentViewCenter gradually
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'building')' in or related to this line: 'if (!cell.building && !cell.unit && deltaToSelection > 1) {' Line Number: 1009
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '22.87842334540943')' in or related to this line: 'var cell = gameMap.cells[cellX][cellY];' Line Number: 1008
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '20')' in or related to this line: 'var cell = gameMap.cells[cellX][cellY];' Line Number: 1008
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (cellX >= 0 && cellX < gameMap.cells.length && cellY >= 0 && cellY < gameMap.cells[cellX].length) {' Line Number: 1007
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (x >= 0 && x < self.cells.length && y >= 0 && y < self.cells[x].length) {' Line Number: 173
User prompt
in handleDrag, update the self.currentViewCenter gradually to make a smooth scroll
Code edit (1 edits merged)
Please save this source code
Code edit (16 edits merged)
Please save this source code
User prompt
in updateMovement, start by rotating in the direction of the movement (given that in assets units are heading -90° initially)
Code edit (1 edits merged)
Please save this source code
Code edit (21 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'cellW')' in or related to this line: 'var cX = (Math.floor(input.x / 100) + centerDeltaX + building.cellW / 2 + Math.floor(building.cellW / 2) - 5) * 100;' Line Number: 1100
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (15 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in or related to this line: 'self.addChild(unit.asset);' Line Number: 1241
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: viewSize is not defined' in or related to this line: 'var screenX = (self.cellX - gameMap.currentViewCenter.x + viewSize) * self.asset.width;' Line Number: 452
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -219,10 +219,10 @@
self.handleDrag = function (input) {
// Clamp the view center to the map boundaries
var targetX = Math.max(14, Math.min(self.currentViewCenter.x + input.x, mapXSize - 7));
var targetY = Math.max(14, Math.min(self.currentViewCenter.y + input.y, mapYSize - 9));
- self.currentViewCenter.x = Math.round(self.currentViewCenter.x + (targetX - self.currentViewCenter.x) * 0.1);
- self.currentViewCenter.y = Math.round(self.currentViewCenter.y + (targetY - self.currentViewCenter.y) * 0.1);
+ self.currentViewCenter.x = Math.round(self.currentViewCenter.x + (targetX - self.currentViewCenter.x) * 0.5);
+ self.currentViewCenter.y = Math.round(self.currentViewCenter.y + (targetY - self.currentViewCenter.y) * 0.5);
console.log("handling drag...", input, self.currentViewCenter.x, self.currentViewCenter.y);
// Update the Text2 object with the new coordinates
self.viewCenterText.setText(self.currentViewCenter.x + ', ' + self.currentViewCenter.y);
//selectionMarker.setOnElement(currentSelection);
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