CS 248: Introduction to Computer Graphics

Pat Hanrahan


Assignment 1

Handed out: Tuesday, January 23, 1996
Due: 5pm, Thursday, February 8, 1996

Your assignment is to implement a simple video game. This assignment is designed to acquaint you with writing interactive programs: you will need to be able to process various input events from the player while simultaneously simulating the events occurring in the game. This assignment will also give you a chance to learn more about basic raster graphics techniques, and the OpenGL system in particular.

Please Note: You should work individually on this project.

At a minimum your game should do the following:

For the purposes of this assignment you may more or less reproduce an existing video game (TETRIS is not allowed). But you are free to experiment and invent a new game if you wish. To get some ideas for your game, you may want to consider variations on the following games:

  • Space Invaders - The player moves a rocket launcher horizontally along the bottom of the screen, shooting missiles at rows of enemy ships that descend from above. When a missile hits an alien ship, both disintegrate. The ship rows move back and forth, and each time they switch direction they move downward. If a ship lands, the game is over. The ships also drop bombs periodically that fall towards the ground. If a bomb hits the rocket launcher, that round of the game is over. You may want to add small barriers that the launcher can hide behind. These barriers are destroyed when hit by bombs or missiles. (This is similar to the game Missile Command.)
  • Asteroid - Asteroids is a simple game where you pilot a spaceship in an asteroid field, shooting asteroids to destroy them before they collide with you. Larger asteroids break into smaller asteroids as you shoot them. The smallest asteroids are simply destroyed when shot. You have a limited amount of sheild power to protect you from asteroids. If you are in a real fix, you can jump into "hyperspace" to get you out of a tight spot.
  • Pong - Each of the two players controls a rectangular paddle which he can move vertically along an edge of the screen. Each tries to hit the ball into the other player's goal while at the same time trying to prevent his opponent from scoring a goal. The ball bounces off of the paddles and the walls and has a constant speed. You may want to have multiple goals and balls (maybe of different speeds and sizes) to make it more interesting.
  • Pac Man - The player maneuvers Pac Man through a maze, trying to eat pills and goodies without encountering a ghost (bad guy). When Pac Man eats a "power" pill the ghosts are temporarily disabled.
  • Your game should be highly interactive; that is, your program should be constantly redrawing to generate moving objects, and requiring continuous input by the user or game player. By these criteria you should avoid card and board games.

    Don't overdo it on the games! To see the level of effort that we expect, try out the two games in /usr/class/cs248/assignments/assignment1. Homan Igehy has implemented a simple space war game (spacewar), and Andrew Beers has implemented a version of asteroids (asteroids). Roughly you should budget about 8 hours of time for this assignment. Each of these example games took between 500 and 1000 lines of C. Although this may seem like a lot of code, in fact most of it is quite straightforward.

    You will need to send us a short text or HTML file describing what files you are submitting and any other information you would like us to consider when grading your assignment, a makefile that allows us to recompile all your code, the complete source to your game, and any other auxiliary files that we may need to run your game. Please also submit a working executable compiled for an SGI machine. Submission should take place using submit, the assignment 1 CS248 submission script.

    We will recompile your program and then attempt to play the game. Your grade will be based on the following criteria: 75% for implementing the functionality that we request, and 25% for the quality of the ``game play.'' Game play covers such factors as the overall refresh rate and interactivity, the aesthetics of the game, and any other features that make one want to play the game. Be forewarned, we will dock up to 10%, if your submission cannot be recompiled and executed, or the instructions are not clear on how to play the game.

    hanrahan@cs.stanford.edu

    Copyright © 1996 Pat Hanrahan