Skip to content

Arijit2175/Raycaster-Java

Repository files navigation

🧭 Java Raycaster Engine

A simple 3D raycasting engine written in Java, inspired by the rendering techniques used in early 90s games like Wolfenstein 3D and DOOM. This project renders a 3D environment using a raycasting algorithm.


🚀 Features

  • Real-time first-person 3D view
  • Keyboard controls using W, A, S, D
  • Smooth movement and rotation
  • Configurable map and camera
  • Pure Java (no external libraries)

🎮 Controls

Key Action
W Move Forward
S Move Backward
A Rotate Left
D Rotate Right

📁 Project Structure


RaycasterProject/
├── Game.java          # Main class which renders the game
├── Texture.java       # Main class for texturing
├── Camera.java        # Main class which handles camera movement
├── Screen.java        # Main class for handling screen display
└── assets             # Holds the textures


🛠️ How to Run

  1. Clone or Download the repository.

  2. Compile the Java files:

  javac Game.java
  1. Run the main class:
java Game
  1. Use your keyboard to explore.

📷 Screenshots

Here's a preview of how the map may look like:

Demo of the map


🧠 How It Works

  • Rays are cast from the camera’s point of view to detect wall collisions on a 2D map.
  • For each vertical screen column, the distance to the nearest wall hit is calculated.
  • This distance is then used to draw vertical slices representing wall height, simulating depth.
  • Movement and rotation are handled by the Camera class, using WASD keys.

📚 References

Here are the references used for this project:


👨‍💻 Developed by - @Arijit2175

About

A basic raycaster implementation in java.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages