3501 #1: A tiny game

Assignment 1: A tiny game

Due date: Wednesday, Sept 22

To get started with XNA, we will use one of the simplest pieces of XNA: 2D graphics using sprites. Your task will be to build a tiny game. The assignment is intended to give you some practice coding in XNA and learning your way around. It also lets you try out a simple game idea you may have had.

Part 1: getting started

  1. Make sure you have XNA Game Studio Express 3.1 running on your computer.
  2. Run it and start a new project (a Windows game).
  3. Start coding!

Part 2: the sprites

  1. Add a sprite and a sprite font to the content of your project.
  2. Add the necessary variables and use Content.Load to load your sprite image and sprite font.
  3. Using the SpriteBatch, draw the image and some text on the screen.
  4. Test your program to make sure that the drawing is working at this point.

Part 3: basic interaction

  1. make a Vector2 variable to hold the sprite's position. Also make a Vector2 variable to hold the current direction of motion of the sprite.
  2. In the Update method, update the position by incrementing it by the direction vector.
  3. Also, modify the direction vector according to the key pressed. (For example, you might have I=up, J=left, K=right, M=down.)
  4. In the Draw method, use your sprite font to display a message on the screen.
  5. Test that everything works.

Part 4: A tiny game

Now that you have got the basics down, use them to build a tiny game. This could be a version of a classic game such as Asteroids or Pong, or it could be a design of your own invention. Remember that you have only a week so keep it simple. Your game can be pretty much anything as long as it meets these basic criteria:

Part 5: bonus


Handing it in

Hand in your project using WebCT. The easiest thing to do is to create a single zipped folder and submit that, rather than all the individual files. It might take a while to upload, so be prepared to take a little break while the files are in transit.