siit-webdev-47 / treasure-hunt-game

1 stars 0 forks source link

On player move, avoid implementing the map state using Array.map() method #20

Closed Adrian-Moldovan closed 1 month ago

Adrian-Moldovan commented 1 month ago

Currently, the map tiles property is updated by calling the Array.map() method, which is ineficient.

We should avoid the iteration and directly modifying the tile by accessing the row and col indexes and de-structuring the object.

Miana-Neagos commented 1 month ago

Improved/ corrected tile update logic in Game component: