A basic raycast example using the Pyxel retro game engine. The project started as an experiment porting the OneLoneCoder CommandLineFPS (see video tutorial here) to Python and Pyxel, but went a bit farther with some dithering and camera control (including "vertical" looking).
A resolution of 240x136 and framerate of a whopping 30fps was achieved using two techniques:
- Interleave rendering (alternate drawing even and odd columns)
- Using one of Pyxel's image banks as a display buffer so the scene can be rendered with a single draw command
Some additional tips, specifically "vertical" look, can be found in this article.
- Python 3.7+
- See requirements.txt
Key | Description |
---|---|
1 |
Reduce FOV |
2 |
Increase FOV |
3 |
Reset FOV |
4 |
Toggle interleave rendering on/off (default on) |
5 |
Increase visible distance |
6 |
Reduce visible distance |
7 |
Reset visible distance |
8 |
Toggle wall boundaries on/off (default on) |
W |
Move forward |
A |
Turn left |
S |
Move backward |
D |
Turn right |
Z |
Strafe left |
C |
Strafe right |
Q |
Look up |
E |
Look down |
X |
Center look |
SHIFT |
Hold to run |