ondras/rot.js — pull request #29 by thesnarky1 (2014-03-29 03:11:59+00:00)
Title: Adding Recursive Shadowcasting which allows for 90/180 degree viewsheds

Good evening,

I kept this separate from the random number pull request because this one is larger and may require more time to vet. I figured it would be easier for you if they're separate changes.

I added an implementation of the Rogue basin recursive shadowcasting algorithm (http://www.roguebasin.com/index.php?title=FOV_using_recursive_shadowcasting) as a new FOV class: ROT.FOV.RecursiveShadowcasting. I needed the ability to render just a 90-degree view of a particular mob in a project I'm working on and figured that other authors might need the same some day. Rather than change the existing classes, this class was created and ported from another Github user's (@pushcx) Ruby implementation of the same algorithm.

For compatibility, this new class will behave exactly the same as the other FOV classes if calling ```compute``` (showing a 360-degree circle of omniscience) but it also allows for 90-degree quadrants (```compute90```) and 180-degree hemispheres (```compute180```). Both of those methods take just one extra argument to note the direction the FOV should be cast in.

Specific changes:
* Added a new file in src/fov/recursive-shadowcasting.js to hold the new class and added it to the Makefile
* Added a comment in src/fov/fov.js to make it clear that compute is for 360-degree viewsheds
* Added tests for 360, 180, and 90-degree viewsheds to the fov.js test spec
* Updated the fov.html page of the interactive manual to demo the various types of viewsheds available for this algorithm.
* Recompiled rot.js and rot.min.js

This is a much bigger change than the other one and I'm in no rush. I do believe it adds more to this toolkit that is in line with common needs for roguelike games. Please look at it when you have time and if you have any suggestions/questions, let me know. I'm more than happy to make any further changes to this to get it up to your standards for the toolkit.

Thanks,