Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 937 Bytes

File metadata and controls

36 lines (23 loc) · 937 Bytes

rust-2d-raycasting

A simple 2D raycasting visualization built with Rust and SDL2.

Description

This project is based on my previous work in C++ adapted to Rust. The player is represented on-screen and follows the mouse pointer. The demo also spawns random line "walls" and renders rays from the player.

Features

  • Real-time raycasting visualization
  • Player movement and interaction
  • Ray-wall collision detection
  • SDL2-based rendering

Prerequisites

  • Rust (stable toolchain, Rust 2021/2024 edition as specified in Cargo.toml)
  • SDL2 libraries
  • cargo (comes with Rust)

Build & Run

From the project root (where Cargo.toml lives):

cargo run

This will compile the project and open a window. Move the mouse inside the window — the player should follow the mouse pointer and rays/walls should render in white.

Controls

  • Mouse movement: move the player
  • Esc or close window: exit the program