Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: 'game.mouseCoordsText.setText(Math.floor(x) + ',' + Math.floor(y) + '\r\n' + cellCoord.cellX + ',' + cellCoord.cellY);' Line Number: 605
User prompt
Fix Bug: 'TypeError: Cannot read properties of null (reading 'currentViewCenter')' in or related to this line: 'return {' Line Number: 595
Code edit (2 edits merged)
Please save this source code
User prompt
in checkBuildingPlacement, take into account the newBuilding cellW and cellH
Code edit (6 edits merged)
Please save this source code
User prompt
pass the currentBuildingForPlacement as an arg to checkBuildingPlacement
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'cellW')' in or related to this line: 'for (var w = 0; w < building.cellW; w++) {' Line Number: 317
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'cellW')' in or related to this line: 'for (var w = 0; w < building.cellW; w++) {' Line Number: 317
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'cellW')' in or related to this line: 'for (var w = 0; w < building.cellW; w++) {' Line Number: 317
User prompt
in checkBuildingPlacement take into account the new building cellW and cellH
User prompt
add a new global function checkBuildingPlacement to handle isValidPlacement computation
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'setText')' in or related to this line: 'game.mouseCoordsText.setText(Math.floor(x) + ',' + Math.floor(y) + '\r\n' + cellCoord.cellX + ',' + cellCoord.cellY);' Line Number: 587
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
implement convertCoordsToCell to return a Convertion of mouse/touch x,y to Cell coordinates
User prompt
call updateMouseCoords in handleDragMove with input x and y
Code edit (2 edits merged)
Please save this source code
User prompt
add a global function updateMouseCoords()
Code edit (10 edits merged)
Please save this source code
User prompt
in the topLeft, add a mouseCoords text defaulting with "X,Y"
User prompt
in handleDragMove, during UserActionState.PLACING_BUILDINGS, tint the building in red when above an invalid placement (sand or building)
Code edit (2 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: 'if (input.y > game.height * 0.80) {' Line Number: 507
===================================================================
--- original.js
+++ change.js
@@ -560,8 +560,12 @@
}
});
}
};
+// Global function to update mouse coordinates text
+var updateMouseCoords = function updateMouseCoords(x, y) {
+ game.mouseCoordsText.setText(x + ',' + y);
+};
function initGame() {
// Create players
player1 = new Player(1, 0xAAAAff);
player2 = new Player(2, 0xffAAAA);
@@ -584,12 +588,8 @@
font: "'GillSans-Bold',Impact,'Arial Black',Tahoma"
});
game.mouseCoordsText.anchor.set(0, 0);
LK.gui.topLeft.addChild(game.mouseCoordsText);
- // Global function to update mouse coordinates text
- var updateMouseCoords = function updateMouseCoords(x, y) {
- game.mouseCoordsText.setText(x + ',' + y);
- };
// Create a Text2 object to display player1's spice level
player1SpiceText = new Text2(player1.spice.toString(), {
size: 50,
fill: '#000000',
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