King Minos has thrown you into the minotaur's labrynth! Can you kill the minotaur, rescue your fellow Athenians, and find your way out of the labrynth?
Controls:
Arrows to move.
Z to attack.
@taxicomics the fog is in a function called "darken" if you want to look at the code.
The basic approach is to render the scene without fog, then calculate light intensity values for each tile on the screen, then draw fog sprites over each tile based on those light values (sprites 3-12 are a ramp from "almost black" to "almost transparent")
Calculating light intensity starts by assigning the player's current location* an intensity of 7.3. Then the neighboring tiles get a smaller intensity, and then the neighbors of those tiles get an even smaller intensity, and so on until you get down to an intensity of 0 (this is a breadth-first traversal).
* Technically it does sub-tile light intensity calculations for each tile adjacent to the player's location. This was added to avoid abrupt transitions when the player moves between tiles. It doesn't do sub-tile calculations for other tiles because it would be more expensive and (I think) wouldn't change the result.
[Please log in to post a comment]