Raycasting renderer

Version:

11.0

Added on:

23 Jun 2024 00:18

Tags:

No tags added for this snippet.

Description:
This is a simple raycasting renderer. It takes the mask of the level and uses it to construct a 3D-like environment the player can navigate. It uses the same principle as e.g. Wolfenstein 3D or the Windows '3D maze' screensaver. Wall colours are determined by the tiles in the level. This works well for some tilesets, less so for others.

This is a proof of concept and could both be optimised and expanded. There are many places where shortcuts or caching could be taken to speed up rendering, the movement code is very rudimentary and there is no texture mapping. This is left as an exercise for the reader.