Lab 8: Missile Command

Overview

In this lab you will create a game similar to the popular Atari arcade game Missile Command. The game will be a bit simpler than the original: you will have unlimited missiles, enemy missiles won’t split up, you don’t have to worry about defending cities, and we won’t track points or high scores. Aside from these features, the main gameplay will be very similar to the original game. You can click the touchscreen to launch missiles from your bases to intercept incoming enemy missiles and cause them to explode. With clever timing you can cause chain reactions and eliminate several enemy missiles with a single shot.

Video of Milestone 3 test program

Designing such a game with many objects moving and interacting concurrently can be challenging. To manage this complexity we will leverage the state machine design pattern. In fact, every object (all missiles and the plane) will be managed by their own independent state machine, with init and tick functions.

Objectives

  • Learn how to create a complex application that requires concurrent programming to complete several parallel tasks. This will be done using the state machine programming pattern.
  • Use optimization techniques to ensure you don’t miss any interrupts.
  • Gain the necessary experience to prepare you for making your own application in the next lab.
  • Have fun and make a challenging game!

Preliminary

  1. Program Organization:. The program is divided into three main parts, and you will complete one per milestone:
    • Milestone 1: In this milestone you will create missiles (in missile.c) that can fly and explode, but do not interact. The test program will create and manage the missiles with no user input.
    • Milestone 2: In this milestone you will create the game control logic (gameControl.c) which will allocate and manage the missiles, accept touchscreen input and detect collisions between missiles.
    • Milestone 3: You will complete the game by creating the plane state machine (plane.c), and update the game logic to tick the plane state machine, and print statistics to the screen.
  2. Class Notes: We will discuss the provided code structures in class using these slides.

  3. Compiling: You will need to write your own CMakeLists.txt file to compile the programs:
    • main_m1.c can be compiled to create the Milestone 1 test executable.
    • main_m2.c can be compiled to create the Milestone 2 test executable.
    • main_m3.c can be compiled to create the Milestone 3 test executable.

Implementation

See Milestone pages:

Files

  • Submitted files:
    • lab8_missilecommand/missile.c
    • lab8_missilecommand/gameControl.c
    • lab8_missilecommand/plane.c

Submission & Pass Off

Follow the instructions on submitting source code to submit your code. You will submit each milestone separately, but will receive a coding standard grade for only your final submission.

Submission

Grade Breakdown

  • Milestone 1: 25%
  • Milestone 2: 25%
    • -10% overall, if you miss more than 1 interrupt
  • Milestone 3: 30%
    • -10% overall, if you miss more than 1 interrupt
  • Code Quality (adhering to the coding standard): 20%