{"repo":"norendren/go-fov","free":true,"listed":false,"github":"https://github.com/norendren/go-fov","clone":"git clone https://github.com/norendren/go-fov.git","description":"2D Field of view calculations for grid-based maps (typically used in top-down adventure/roguelike games). Uses Recursive Shadowcasting!","language":"Go","stars":43,"topics":["fov","shadowcasting","game-development","golang","ebiten","roguelike","roguelike-games","roguelike-library","2d-game-development"],"license":"MIT","category":"game-templates","readme_excerpt":"go-fov go-fov is meant to provide an easy-to-implement and (relatively) unobstrusive way to quickly add field of view to a top-down, grid-based game (it was made with traditional roguelikes in mind). go-fov uses recursive shadowcasting to track the cells which are considered \"visible.\" For a much better explanation on the algorithm than I could ever provide, please see this roguebasin article or an absolutely wonderful technical explanation from Gridbugs Installation Usage Quickstart Requirements Example Implementation Initialization The \"Update\" Section The \"Draw\" Section Pictures Installation To use go-fov: import \"github.com/norendren/go-fov/fov\" and go get to acquire the dependency. Or to retrieve it independently: Usage go-fov is intended to be unassuming, while still providing the efficiency that recursive shadowcasting brings to FOV calculations Quickstart If you can already tell go-fov trying to provide, you may not need a long-winded explanation, and the following three steps will be enough to get you started: 1. Instantiate a View with myFOVCalculator := fov.New() and store it alongside your map and player data 2. Each time the player moves, call myFOVCalculator.Compute(yourMap, playerXCoord, playerYCoord, radius) 3. When drawing your map, check if the map coordinate is visible by calling myFOVCalculator.IsVisible(x,y) And that's it! --- Requirements Three things are required: An instance of the View struct, which represents the current \"view\" of the player at the t","default_branch":null,"files":null,"tree":[],"storefront":"/r/norendren","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/norendren/go-fov/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}