From c03c6131d37c95bda51acce1c86f93769285ec1f Mon Sep 17 00:00:00 2001 From: elioat Date: Fri, 29 Dec 2023 16:58:24 -0500 Subject: * --- js/game-frame/game.js | 17 ----------------- js/game-frame/index.html | 4 ---- 2 files changed, 21 deletions(-) (limited to 'js') 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 @@

- -- cgit 1.4.1-2-gfad0