Allegro.cc
Projects
Action252
Adventure22
Arcade216
Board Games30
Demos24
Emulators10
Other68
Puzzle139
Role Playing40
Sports25
Strategy58
Utilities46
Resource Directory
Code Gallery3
Compilers12
Help & Documents13
Libraries63
Media2
Tools8
IOTD: Line-of-Sight
Line-of-Sight
Line-of-Sight, by Jim Sinha

Games like Soldat and Meteor2 would really benefit from this.

--> DOWNLOAD source-code and example.exe <--

Crappylos tool - 2D Line-of-Sight for Allegro. It
blacks out areas behind walls which the player/character cannot see.
Polygons and line segments are the supported input types.

The current code has overdraw, but is "C" compatible.
A future C++ version "Simplelos tool" will eliminate overdraw. I'll also add a utility function for your level editors to test whether your concave polygons are CW or CCW. Perhaps a vertex reverser too.
Well, now that there's a screen shot, I'll check it out. - Miquel Burns
--> Utility Function polygon_force_CW( *verts, num_verts) <--
is ready for your level editors. - Jim Sinha
This section is only available to registered Allegro.cc members.



The Gallery | Add your own image!
Poll
Is grammer and spelling important?
View Results