Skip to content

LucienRbl/rust-2d-raycasting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A simple 2D raycasting visualization built in Rust using SDL2 as rendering engine.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages