This is a simple First-Person Shooter (FPS) simulator implemented in C++ using console graphics. It uses Wolfenstein's ray casting algorithm to render a 3D-like environment in the console window.
www_screencapture_com_2024-6-8_18_26.mp4
- Basic 3D rendering using ray casting
- Simple movement controls (W, A, S, D)
- Basic collision detection with walls
-A simple ray casting rendering similar to the Wolfenstein 3D engine. The red dot is the player's location. The orange area represents the player's field of view.
- Windows OS
- Visual Studio (or any other C++ compiler supporting Windows API)
- Unicode support in the console
-
Clone the repository:
git clone https://github.com/yourusername/fps-simulator.git cd fps-simulator -
Open the project in your C++ development environment (e.g., Visual Studio).
-
Build the project.
After building the project, you can run the executable. The simulator will open in a console window.
W: Move forwardS: Move backwardA: Rotate leftD: Rotate right
- Screen Buffer: A character array (
wchar_t* screen) used to render the display. - Map: A simple string representation of the game world, where
#represents walls and.represents open space. - Player: The player has a position (
fPlayerX,fPlayerY) and an angle (fPlayerA).
- Input Handling: Reads the input from the user to move and rotate the player.
- Ray Casting: Utilizes Wolfenstein's ray casting algorithm to determine the distance to the nearest wall for each column of the screen.
- Rendering: Fills the screen buffer with the appropriate characters to represent walls, floors, and the player.
- Ray Casting: Determines the distance from the player to the nearest wall for each column of the screen using Wolfenstein's ray casting technique.
- Collision Detection: Prevents the player from moving through walls.
- Rendering: Updates the screen buffer with the current game state and displays it.

