Pyweek is a wonderful excuse to expand knowledge. This time, it's Opengl.
Ratings (show detail)
Desided to go with "slightly transparent" over "over the top of everything"
Final, I think.
version 0.05; most gameplay accounted for
Got most of the vision tracing done. (Some nasty algorithms for that.)
Got the sightrange display working
Version 0.03. Framerate's a bit low, but the basic algorithms work.
Monster's Tower, non-working lights version
basic environment completed
The Monster's Tower
Your tower has been invaded by horrible humans. Devour all of them to be freed from the menace. But stay out of their sight...
Top down view, all enemies have a marked field of view (flashlight style). Get close enough, and you can devour a human.
Should be interesting...
Well, it turns out that opengl lights are significantly harder than I thought. Basically, I think I'm doing everything right, but no lights show up. After close examination of both the nehe tutorials, and the opengl docs, I'm giving up for now. If somebody actually "gets" opengl lights, a pointer or two could be useful...
Anyway, I'm going to get the level editor working instead.
Well, I gave up on opengl lights. I think I would get them working properly, but that would take too long.
What I have done instead, is have two textures for the floor (light and dark textures). Normally, the dark texture shows, but when an enemy is looking in a direction, I overlay it with a light texture. Some interesting math in display.py, if that's your thing...
Finally, you can't see it very well, but the sight triangle is actually cone-shaped, and can be partially blocked by walls.