Overview

This is a basic sonic game. I would have loved to develop more on it, however there was just not enough time. The only "game" part so far is to collect all the rings on the track in the least amount of time. When you get the last ring, the clock will stop and turn read, showing you what time you got. You can then reset the game by pressing 'z'.



Controls

'w' Move Forward
'a' Turn Left
'd' Turn Right
Space Jump
'p' Pause
'8' Move Camera Closer
'5' Move Camera Further Away
'4' Move Camera Left
'6' Move Camera Right
'z' Reset Game
'q' Quit


Screen Shots



Implementation Details

Sonic is drawn using a 3ds model file that I obtained. Credit goes to Athbucket Animations for creating the model. I then broke sonic up into five pieces: Left lower leg, right lower leg, left upper leg, right upper leg, and the rest of him. I then turned him into a hierarchical model for animation. There are different "stages" of the running and jumping animation. The faster you go, the faster sonic progresses through those stages.

I implemented sound using OpenAL. I stole sounds and the background image from the original Sonic 2 game on the Genesis. The sounds include the background music for the Emerald Hill Zone, the jumping sound, the ring-getting sound, and the special stage sound (used when you get all the rings).

There is collision detecting with the rings and the boundries of the track. Currently you are not allowed to leave the track. The way this is done is as follows: The track is made up of pieces the same size as the actual polygons used to draw it. Those polygons are set up as "boundries" such that it has a number of sides. Each side can either be a boundry (you can't go past it) or a pointer to another polygon. As Sonic moves around, there is always a current piece of track that he is currently on.

There is also a blur effect on the whole screen when Sonic is running at his top speed. This is done by lowering the R, G, B, and alpha values of OpenGL's accumulation buffer. This ends up mixing colors of different frames together, to create a blur effect.



Conclusion

This was a really fun project. Although being a die-hard Sonic fan really improved my motivation, I was also motivated by how much I was learning by doing this. I would have loved to make this game more realistic and "Sonic-like", however the time wasn't there. Perhaps in the future.