================Latest Footage March 21 2014===========================================================================
Original Post March 13 2014:This is a little Flash / Actionscript 3 project I've been working on the last few days that I thought I'd make a dev log for.
It's basically a top down adventure sort of game made with AS3 in Flash. I'm using nape for the physics (awesome 2d physics engine), and doing it all myself.
Here's a small preview of the game so far. I'm trying to implement a sort of "field of view" shadow where you can't see around walls that are blocking your view, by drawing a big black shadow over parts the player can't see.
In this GIF I just basically cast rays out around the player and use those to draw the shadow, but it's not ideal.
It's too jittery and crappy, and slow, using this ray cast method. So now I'm working on the new algorithm for drawing the field of view. My approach is using a method where I auto generate a list of the "connections"/"corners" between the walls in the map, and use those corners to draw the fog/shadow.
So far I've got it generating the corners correctly and putting them in order of orientation from the player, so I can start to draw the shadow out of them. Each corner knows whether it's connected upward, downward, left or right, and calculates its orientation from the player, which should be enough information for me to loop round them in a clockwise motion and draw a big black shape for the shadow.
Here's a quick preview where I'm just drawing the shape between EVERY corner in order of orientation. It's a start.
Edit:Starting to get somewhere with this. Still a lot of bugs in it in certain cases!