I used OpenGL and GLUT for the graphics portion of my project. It was simple as everything was done in a 2D, top-down perspective. I draw all the rink markings, the puck, the two defenseman, a teammate for the defenseman, and one player from the opposition.
All the fuzzy logic control is contained within a Simulation object that I define. You can also click and drag all the objects on the ice. The defensemen will be limited to their lane along the ice and they will immediately react to their new position once you let go of them. You can attach the puck to the opposition or teammate player so they move as a single object. This is great for seeing how the defensemen react to rushes by the teammate and the opponent. I call this group selection mode. Last, but not least, you can change the score and time of the game. Experiment to see how the defensemen react at the end of the game when the scores are different. There is also a possession indicator that tells you which side has the puck at any time. Look for it to the right of the rink.
Here's a summary of the commands. Please note that when entering the keyboard commands, the window focus should be on the rink display (simulation) window.
Changing object positions
The user can change the position of the defensemen, teammate, opponent, and puck by clicking on and dragging the particular simulation object.
Moving with the puck – “g” key
The simulation allows the user to move both the teammate and the puck or the opponent and the puck at the same time. This effectively creates the effect of a player skating with puck. To do this, hit the “g” key with the simulation window active. This will enable group selection. Now click and drag either the teammate (in green) or the opponent in (yellow) to the puck. Once contact is made, the puck will stay with the object. To disable group selection, hit the “g” key again.
Changing the game score – “s” key
With the simulation window active, hit the “s” key to change the score of the game. Then bring up the console window and answer the questions to change the score.
Changing the game time – “t” key
With the simulation window active, hit the “t” key to change the game time. Then bring up the console window and answer the questions to change the game time.
Quitting the simulation – “q” key
To quit the simulation at any time, hit the “q” key.