Or rather anyone in the game whose field of view sees the light from a light source can. Dungeon now looks blank outside of the light radius, except for walls which remain on the map whether you can see them or not. Light radius algorithm also acts as a field of view algorithm.
Unfortunately I'm not quite happy with it, at the moment it spreads rays from the centre of the character and counts a square is in view if the square is traversed 1 pixel along the line, unfortunately that produces situations where A can see B, but B cannot see A.
I'll revisit it in the future and come up with a better algorithm that doesn't visit the same squares multiple times, but the time being something that functions is better than something that doesn't.
Monsters have been displayed on the map and carry their own light sources, well monster type singular, a kobold, more will be introduced of course.
Still debating on the size of the graphics tile's I will be setting as standard, at the moment they are 25*25 which may be a bit large, I might take it down to 16*16.
Next up will be a combat system, first of all the player hitting monster and the monster dying, then figuring out some kind of turn counter and allowing the monster to fight back. After that monster hunting algorithms will be needed so they stand a chance against the over powered adventurers.
No comments:
Post a Comment