Skip to content

2d visibility algorithm in JavaScript ported from the Red Blob Games article

License

Notifications You must be signed in to change notification settings

Petah/2d-visibility

 
 

Repository files navigation

2D Visibility Algorithm Demo

Fork of https://github.com/Silverwolf90/2d-visibility

This is a 2d visibility algorithm described in this article, ported by hand to TypeScript and slightly refactored.

I highly suggest reading the article. It's very well explained with some really awesome interactive examples and provides the code in multiple languages. The original code was written in Haxe, which can compile into JavaScript but I found the generated JS to be rather difficult to read and comes with an (unnecessary) doubly linked list implementation.

Building the demo

Screenshot of demo

Clone the repo, npm install then run npm run build and open index.html in your browser.

About

2d visibility algorithm in JavaScript ported from the Red Blob Games article

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 91.2%
  • JavaScript 7.1%
  • HTML 1.7%