Update Notes

Bill Niblock 2024-08-20 18:35:44 +00:00
parent e3917c212c
commit 584aeba03c

@ -4,4 +4,17 @@ Considering there is a callback function when calling the map function, it may b
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.
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.
Considering palette swapping again. If I have the color, then a light grey, a dark grey, and a black, I think I can accomplish what I want. The light green will be one of 4 colors: light green, light grey, dark grey, or black. Sand will follow: brown, light grey, dark grey, black. The other colors start off darker, and so transition more rapidly: water goes from blue, to dark grey, to black; dark green to dark grey to black. In the latter case, there are still 4 shades, just the last two are black. Thus there is an array for each color:
```
{
{short {<light_green>, <light_grey>, <dark_grey>, <black>}}
{long {<dark_green>, <dark_grey>, <black>, <black>}}
{sand {<brown>, <light_grey>, <dark_grey>, <black>}}
{water {<blue>, <dark_grey>, <black>, <black>}}
}
```
Every time a tile is drawn, check the light level, and set the corresponding palette color accordingly. This doesn't have to happen every tick, though. The map only changes during certain scenarios: when the map is first drawn, to account for initial light sources; when the ball is hit, to account for the ball lighting up the course; when the player uses their flashlight. When these events happen, the map tiles can be updated. Otherwise, everything is set in memory, and no changes need to be made, just draw what's there.