IC211: Lab 6
This lab will enhance your Tron lab by adding multiple classes in an
hierarchy with inheritance. If you organized your earlier lab poorly,
this is a great chance to make it better.
There will be multiple types of objects in the game. The base class
will be the simple 'GameObject'. From there there are two derived
classes: MobileObjects and StationaryObjects. Under MobileObjects are
Cycle and Pedestrian. Pedestrians move randomly, but their moves are
the same as cycles: moveForward, turnLeft, or turnRight. Cycles are
player controlled and can be either regular (Cycle) or
- Create the classes described above. Think carefully about how
you organize things to maximize code re-use and clarity.
- Fix your main to work with the new classes. Enhance your main
so that there can be more that 2 players, and each player gets to
choose to be regular or light-cycle. Ask the user for the number
of Pedestrians and the number of StationaryObjects.
- The program should get input and move each of the players, and then move
the rest of the objects.
- If requested by your instructor, show him your working program.
- You're mature enough now that just showing something to your
instructor is not sufficient. You will turn it in as well.
- Comment your program.
- Javadoc your program.
- Submit your program using the appropriate submit script.
Different sections will have different scripts, so ask your instructor.
- Your lab is not turned in until it has been correctly
submitted via the script, and shown to the instructor if
The project will take two labs to complete. The
files must be submitted by the start of lab on March 3.