Skip to content

pietrykovsky/python-raycaster

Repository files navigation

python-raycaster

A simple raycaster written in Python using Pygame.

Preview

Preview

Installation

Clone the repository.

git clone https://www.github.com/pietrykovsky/python-raycaster.git

Create a virtual environment and install the dependencies.

python -m venv venv

Activate the virtual environment.

# unix based:
source venv/bin/activate
# windows:
venv\Scripts\activate

Install the dependencies.

pip install -r requirements.txt

Usage

Run the program from the project root.

python -m raycaster

Controls

  • W - Move forward
  • S - Move backward
  • A - Move left
  • D - Move right
  • ARROW LEFT - Turn left
  • ARROW RIGHT - Turn right
  • SPACE - Shoot
  • ESC - Quit

Settings

The settings can be found in raycaster/core/settings.py.

To change the resolution, modify the following variables:

# GAME RELATED
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600

Change the volume:

# SOUND RELATED
MASTER_VOLUME = 1.0
MUSIC_VOLUME = 0.25
EFFECTS_VOLUME = 0.5

If you suffer low FPS, try to change the RAY_COUNT variable and decrease the ray count:

RAY_COUNT = 200

Resources:

About

A simple raycaster written in Python using Pygame.

Resources

License

Stars

Watchers

Forks

Languages