CSC 352

Game Development

Lab 03 - Spaceship Autopilot

This assignment is to add a ByteCode - based interpreter to your spaceship program. You'll also implement basic collision detection.

Step 1: Collision Detection

  1. Add a rock class that displays a rock floating in your spaceship world. It should sit in one location, but rotate slowly.

  2. Create a bunch of rock instances and store them in a vector or linked list.

  3. Implement collision detection in your game loop. Every time your move your ship, you should see if your spaceship hit any rocks.

Hints

Collision Detection can be complex (per-pixel or pixel perfect collision detection) or simple (bounding box / collider-based detection). Here's some basic math on collision detection that uses bounding boxes.

Step 2: Autopilot

Implement a bytecode interpreter for your spaceship that allows you to navigate an asteroid field without crashing.

In other words, given a set of asteroids in specific positions, you should be able to specify a string of characters which the game loop will use to move your spaceship through the field.

Grading

Out of 100 points:

Architecture (50 Points)

0 Points - Code doesn't compile

10 Points - Everything is in main.

25 Points - There's a rock class and a vector or list of rocks.

30 Points - There's a game, spaceship, and rock class, but main is still doing too much.

50 Points - The main function just initializes the Game class and starts the game loop. The Game class has multiple functions for each part of the game loop, and the spaceship class is properly architected.

Features (50) Points:

0 Points - Code doesn't compile

10 Points - The spaceship appears, moves, and rotates.

20 Points - The spaceship can handle one or two autopilot commands.

35 Points - The spaceship can navigate the asteroid field without crashing.

50 Points - The spaceship can navigate the asteroid field and perform dare-devil tricks, such as looping asteroids, figure-eights, etc...

Submission:

  1. Navigate to the folder containing your source code.
  2. Create a zip file of your entire project.
  3. Upload that zip file to mySVU.