diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/game-frame/game.js | 17 | ||||
-rw-r--r-- | js/game-frame/index.html | 4 |
2 files changed, 0 insertions, 21 deletions
diff --git a/js/game-frame/game.js b/js/game-frame/game.js index e64bfa7..b0f3fb6 100644 --- a/js/game-frame/game.js +++ b/js/game-frame/game.js @@ -341,20 +341,3 @@ window.addEventListener('keydown', (e) => { player.y = newY; } }); - -canvas.addEventListener('click', function(event) { - // Calculate the mouse position - var rect = canvas.getBoundingClientRect(); - var mouseX = Math.round(event.clientX - rect.left); - var mouseY = Math.round(event.clientY - rect.top); - - // Calculate the map coordinates - var mapX = Math.floor(mouseX / TILE_SIZE); - var mapY = Math.floor(mouseY / TILE_SIZE); - - // Write the map coordinates to the DOM element - document.getElementById('coordinates').innerText = 'Map grid: x ' + mapX + ', y ' + mapY; - - // Write the canvas coordinates to the DOM element - document.getElementById('canvasCoordinates').innerText = 'Canvas: x ' + mouseX + ', y ' + mouseY; -}); \ No newline at end of file diff --git a/js/game-frame/index.html b/js/game-frame/index.html index 8a53a06..ec1826a 100644 --- a/js/game-frame/index.html +++ b/js/game-frame/index.html @@ -11,10 +11,6 @@ <p id="stats"></p> <canvas id="gameCanvas"></canvas> <p id="dialog"></p> - <ul> - <li id="coordinates"></li> - <li id="canvasCoordinates"></li> - </ul> </main> <script src="game.js"></script> </body> |