Writing 2D games using super simple Haskell
summary
Walks through a working 2D shooter coded in super simple Haskell that uses GLFW + OpenGL for rendering, MVar to sync engine and game state across threads, and a small engine called playtime wired with stepGameState and visualize. Implements frame-rate–independent motion via delta time, texture sprites (1024×768 demo), background stars, enemies (about 10 spawned), heart bullets, and rectangle collision detection; bullets and enemies are removed on collision. Live reloading uses a GHC interpreter; code: https://github.com/cvogt/2020-07-01-haskell-game-demo.
AI-written summary · about
chapters (14)
- 0:00Introduction to talk
- 1:10Live game demo overview
- 2:58Game state and initial setup
- 4:24Handling keyboard events
- 7:35Moving stars background
- 9:19Adding enemies to game
- 12:49Shooting mechanics
- 14:36Collision detection
- 17:07Engine visualization
- 18:55Engine configuration
- 21:45Game loop and rendering
- 24:17OpenGL rendering details
- 25:18Collision detection logic
- 26:01Q&A and closing
