OO FOR GAME ENGINES

Introductions

Introduce yourselves!

Icebreaker: What game are you playing most right now?

Groupwork

Assume you want to design a racing game with three vehicle types: Jeep, Truck, and Tank.

Group work:

  1. Design classes that support this game, specifying needed methods.

  2. Assume the game was running and the current vehicle was stored in the variable V of type Vehicle.

    1. What class's code gets executed when the vehicle moves (move() is called)?

    2. What class's code gets executed when the vehicle fires (fire() is called)?

    3. What happens if the vehicle is a Jeep and it tries to fire?