-
Notifications
You must be signed in to change notification settings - Fork 2
Home
I'll start with a disclaimer that I have myself only started learning Haskell a little while ago, so this series of articles isn't so much about me trying to teach others, but rather something that I'm doing to improve my own grasp of both Haskell and OpenGL, and to see for myself how well Haskell is suited for game programming.
The idea is to implement the classic game of Asteroids using Haskell, OpenGL and GLUT. I'm not a big fan of GLUT actually, but in order to make it easy for anyone to compile the program on Windows, Linux and MacOSX, I'm restricting myself to libraries that are available pre-built with the Haskell Platform.
The first part will setup all the boring boilerplate required to get us running an OpenGL window, and after that we'll gradually build the game in small iterations, each of which adds some small new functionality to the game. The aim is to isolate the OpenGL code as much as possible from the actual game code, and to use pure functions and immutable data structures whenever possible. In the last part, we'll look at how the game performs, and possibly optimize some parts to use mutable data structures and shared global state, if necessary.
- The Groundwork
- Iteration 1: Rendering the Ship
- Iteration 2: Rotating the Ship
- Iteration 3: Introducing Animation
- Iteration 4: Keyboard Controls
- Iteration 5: Ship Movement
- Iteration 6: Improved Timing
- Iteration 7: Frame Interpolation
- Iteration 8: Asteroids
- Iteration 9: Wrap-around
- Iteration 10: Collisions
- Iteration 11: Pew Pew
- Iteration 12: Bullet Limits
- Iteration 13: Bullet Collision
- Iteration 14: Destructible Asteroids
- Iteration 15: Splitting Asteroids into Parts
- Iteration 16: Randomized Asteroid Appearance
- Iteration 17: Code Cleanup and Refactoring
- Iteration 18: Particle Effects
- Iteration 19: Regaining Purity
- Iteration 20: Text Rendering