From: Daniel Karbach Date: Mon, 25 Mar 2024 10:55:33 +0000 (+0100) Subject: better background image X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=7514794352d72e31689d161a6a7658604ddc1249;p=alttp.git better background image --- diff --git a/resources/js/components/tracker/Map.js b/resources/js/components/tracker/Map.js index 520ad93..9c27a34 100644 --- a/resources/js/components/tracker/Map.js +++ b/resources/js/components/tracker/Map.js @@ -657,6 +657,25 @@ Location.propTypes = { size: PropTypes.string, }; +const makeBackground = (src, level) => { + const amount = Math.pow(2, Math.max(0, level - 8)); + const size = 1 / amount; + const tiles = []; + for (let y = 0; y < amount; ++y) { + for (let x = 0; x < amount; ++x) { + tiles.push(); + } + } + return tiles; +}; + const Map = () => { const { dungeons, setState, state } = useTracker(); @@ -764,34 +783,7 @@ const Map = () => { > - - - - + {makeBackground('lw_files', 10)} {lwLocations.map(l => @@ -804,34 +796,7 @@ const Map = () => { - - - - + {makeBackground('dw_files', 10)} {dwLocations.map(l =>