Game programming exercises
From DmWiki
These are just suggestions. Be creative, and feel free to add exercises you found useful. The exercises given here will require you to read some sort of book on your chosen language, and later on DirectX, OpenGL or SDL for the game exercises. You will probably come across new terms - Google them to find out more information.
| Table of contents |
[edit]
First Steps
- Print Hello World to the user
- Print the even numbers from 1 to 20 (look into for loops)
- Create a function to print the sum of two numbers given to it
- Create a recursive function to compute the factorial of a given number
[edit]
Into the world of games
- Open a blank window, that the user can close
- Draw a small sprite on the screen
- Make the sprite move around the screen
- Allow the player to move a sprite with the keyboard
- Detect when the player collides with another sprite , and take some action - i.e. remove sprite
- Add walls, and create a move function so the sprites cannot be moved through the walls
- Create a pacman style game from everything you have learned. You will need to keep scores and organise the game into screens (intro, playing, paused, death).
[edit]
Jump to the third Dimension
- Draw a mesh to the screen in 3d
- Apply a texture to the mesh
- Allow the player to move around with the keys
- Make a simple form of collision detection so the user cannot move through an obstacle
- Load up some ground and blocky buildings
- Apply collision detection to this more complicated scene
- Apply octree culling
[edit]
Further Learning
- Create a small decision tree so that you can train an avatar to perform one of a few actions in response to stimuli
