ray_engine icon indicating copy to clipboard operation
ray_engine copied to clipboard

A toy raycasting engine in Go + Ebiten

ray_engine

A toy raycasting engine built with Go + Ebiten v2 2D library

Heavily based on 3DSage fantastic Youtube videos of a C/OpenGL raycasting engine

Gun mode ! (old version of the engine with scaling issues)

img

2D map rendered in 3D

img

CRT scanlines

img

Build & run

Build with Go 1.16 and Ebiten v2 on Linux/macOS

 go build
./ray_engine

Keymaps

Arrows keys or ZSQD (Azerty) : Move

'i' : debug info toogle

'f' : fullscreen toogle

'l' : scanlines

'm' : Gun mode

'k' : quit

Features, todos and idea box

  • [X] Port to Ebiten v2
  • [ ] Proper collisions
  • [ ] UI
  • [X] Scale map to 16x16
  • [X] 2D minimap for gun mode
  • [X] Add basic floor/ceiling - Just a matching png for now
  • [ ] Binary textures wip
  • [ ] Up/down parallax/Y-xhearing
  • [ ] Ebiten Audio mp3 sound support
  • [ ] Weapon swap/shield
  • [ ] Proper ballistics - Rough prototype
  • [ ] Cube destruction/basic enemies - Rough prototype
  • [X] Rebuild the 2D map (where actual raycasting is done) to fit the screen

Known bugs

  • [ ] Enemies are seen through walls

Assets

Gun from Destiny 2 screenshot by Bungie