A 2D raycasting engine built in MonoGame.
W/S: move forwards/backwards
A/D: move left/right
Left/Right: look left/right
Ensure Visual Studio and MonoGame are installed.
Clone the project by running git clone https://github.com/csaye/mono2d
Open in Visual Studio and press the big play button or use F5 to run.
public const int Grid = 1; // Size of grid
public const int GridWidth = 512; // Width of grid
public const int GridHeight = 512; // Height of grid
private const int Width = 64; // Width of map (x)
private const int Height = 64; // Height of map (y)
private const float Fov = Pi / 2; // Base field of view
private const float RayStepDist = 0.1f; // Distance between ray steps
private const float MaxDepth = 64; // Maximum ray depth
private const float Speed = 8; // Base walk speed
private const float Spin = 1.5f; // Base rotation speed