Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 1.21 KB

README.md

File metadata and controls

24 lines (17 loc) · 1.21 KB

Elm Raycasting

Live Demo!

Building a ray casting 2D to 3D projector (a la Wolfenstein 3D) using Elm and HTML5 Canvas.

Elm Ray Casting Screenshot

Explanation

Usually game design is a very object-oriented endeavour, so I thought it would be a particularly fun challenge to see if I could get ray casting working in a functional language. For a coding interview I had been given a project to create a navigable 2D grid using the language. After whipping that out I decided it'd be a good opportunity to put Elm through it's passes. I quickly found out that Elm has a very limited tool-set for Html5 Canvas and animation, and therefore isn't the most efficient language for this type of thing. However, I had an absolute blast putting this together over about 8 hrs. Even hastily written code looks pretty tidy in Elm.

Todo:

  1. Setup canvas
  2. Build map
  3. Add player dot
  4. Get player dot moving / turning
  5. Fix the choppy animation framerate
  6. Collision Detection
  7. Calculate FOV rays
  8. Calculate ray collisions
  9. 2D += D
  10. Color floor/ceiling