Skip to content

A Rust implementation of Adam's FOV algorithm, primarily intended for roguelikes.

License

Notifications You must be signed in to change notification settings

Ztry8/RoguelikeFOV

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoguelikeFOV

A Rust implementation of Adam's FOV algorithm

Usage in Сargo.toml

roguelike_fov = { git = “https://github.com/ztry8/roguelikefov” }

Example

use adam_fov_rs::*;

// Create a 50x50 visibility map
let mut map = VisibilityMap2d::default([50,50]);

// Set the tile at (15,15) to opaque
map[[15,15]].opaque = true;
 
// Compute our visible tiles and add them to the map
fov::compute([15,14], 5, &mut map);

// The space directly above our opaque tile is not visible
assert!(!map[[15,16]].visible);

About

A Rust implementation of Adam's FOV algorithm, primarily intended for roguelikes.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Rust 100.0%