How moumoulongs/raycast-2d works
raycast-2d is a Windows console raycasting demo. The main loop accepts movement keys, updates the camera, raycasts the map into a character-cell canvas, and presents the frame. The README gives no further capability detail; the map is defined in the entry-point source. Source excerpts establish the principal calls, while the math helper and map declaration are shown but their broader use is not expanded beyond supported links.
Main entry points: camera.h Camera and raycaster · main.cpp Input and frame loop · screen.h Canvas and console output · worldMap.h Map declaration
Components 7
Runtime loop
- Input and frame loop
src/main.cpp
Raycasting
- Camera and raycaster
include/camera.h - World map data
src/main.cpp - Map declaration
include/worldMap.h
Console display
- Canvas and console output
include/screen.h
Core data
- 2D vector math
include/vec2.h
Other components
- Keyboard user
Connections 8
- Keyboard user → Input and frame loop: presses keys
src/main.cpp - Input and frame loop → Camera and raycaster: updates and renders
src/main.cpp - Input and frame loop → Canvas and console output: presents and clears
src/main.cpp - Camera and raycaster → Canvas and console output: draws wall lines
include/camera.h - Camera and raycaster → World map data: reads collision cells
include/camera.h - Input and frame loop → World map data: defines map
src/main.cpp - Camera and raycaster → 2D vector math: uses vectors
include/camera.h - Camera and raycaster → Map declaration: includes declaration
include/camera.h