robinerd / 2d-shadows-viewport Goto Github PK
View Code? Open in Web Editor NEWThis is a small test I implemented in java to experiment with creating shadows blocking sight behind objects relative to the mouse cursor. Could be used in some kind of maze game forcing the player to explore the level instead of just tracing a path. The shadows are generated per pixel from an object map. The code is too slow for making a good realtime game, due to lack of hardware acceleration. Still, lots of improvement on performance has been done by trying different ways of computing shadows. For bettter performance the shadow calculation could be implemented with hardware acceleration using for example OpenGL or xna