Thinkin' bout darkness

Bill Niblock 2024-08-20 18:17:07 +00:00
parent c08459eb89
commit e3917c212c

7
Notes.md Normal file

@ -0,0 +1,7 @@
# Drawing the Map in Darkness
Considering there is a callback function when calling the map function, it may be possible to configure an array corresponding to each map tile to be drawn. The array can mark if the tile should be shown or not. If it should be drawn, then the tile is drawn. If not, then the tile should be just a black tile. The challenge here is that the map function returns a tile, and not a coordinate.
It might be preferable to instead draw the map with our own function. This would allow us to modify it on draw, and also only draw it when things change. Rather, we won't be drawing the map with our own function, but updating the map memory.
Maybe there's a way to use bankswitching to solve this: Use the map in bank 2 as the real-time map, and the map in bank 1 as the original map. Then, have an array of lighting status. Whenever the map should be updated, call an update function to evaluate the lighting array against the bank 2 tiles. If it should be lit, then pull it from bank 1. If it shouldn't, then leave it as is. Once updated, draw the new map.