- Prof. Dancy's Site - Course Site -

Stranded: The Rover Game

Objectives

  1. Use object-oriented design and 2D arrays (Phase 1 & 2)
  2. Implement and use a List ADT as linked nodes (Phase 3)
  3. Implement and use a Stack ADT as linked nodes (Phase 4)
  4. Implement and use a Queue ADT as a circular array (Phase 5)
  5. Do a Big-O analysis on an ADT (the Queue) implementation (Phase 5)

The Story

The year is 2022. Personal space transport is common and you have taken your space ship out exploring. You find an ancient abandoned planet and decided to land and investigate. There was a huge storm as you landed and your ship now lies in pieces on a landing pad. There is no oxygen in air but you are able to move around in your rover. You have a repair manual, which tells you how to fix your ship, but you don't have the needed spare parts.

You see strange items scattered around on the ground. Maybe they will be useful. You also see strange glowing orbs big enough to swallow your rover. When you touch one, you get sucked in and appear in another place with items and orbs. The orb was a portal! When you re-enter the same portal, it takes you back where you came from.

Your goal is to move about the portal system and collect enough spare parts to fix your ship.

Rover ScreenShot

Other Phases

Phase 1 | Phase 2 | Phase 4 | Phase 5 |


Phase 3: Gathering An Inventory

The objective of phase 3 is to make the inventory and 'pick up' button work. Whenever the 'pick up' button is clicked in the interface, pick_up(self) will be called in your Game class. The rest of the implementation is largely up to you, but you should follow these rules:

Inventory in a List

The inventory is a list of parts the rover is carrying. The inventory shows as a string in the inventory field of the GUI. Think carefully how you want to design your Inventory so that you can keep track of the number of each item.

The get_inventory(self) function in Game.py will expect you to return a string representing your current inventory. For Example:

3 Cabbage
1 Screw
2 Gear

Grading breakdown

Graded item Number of points
General Running
The rover and ship components and the parts all still have working images 5 pts
The quit button still works 5 pts
The rover can still move 5 pts
The rover can still stand on things 5 pts
The rover can still go through portals 5 pts
List
Parts in the inventory must be stored in a List ADT written by the student (not built into python). 5 pts
The List is implemented as linked nodes 5 pts
Using your List ADT (not outside methods!), you can retrieve the name and count of each item 5 pts
A part is only in the List if its count is above zero 5 pts
Inventory
A part is only in the Inventory if its count is above zero 5 pts
Parts displayed in the inventory must have names (such as Cake or Cabbage) 5 pts
Parts must be displayed with their count (if the rover has 3 cabbages, ‘3 Cabbages’ or ‘Cabbages 3’) 5 pts
The string given to the GUI must fit neatly in the space provided for the inventory 5 pts
The “.ppm” part of an image name is not displayed 5 pts
Pick-Up Button
The rover can pick up the parts (cake, gears, etc.) lying around the room 5 pts
The rover cannot pick up the portals or the ship components 5 pts
If the rover is standing on a part and tries to pick it up, it succeeds 5 pts
If the rover is standing on empty space, a portal, or a ship component and tries to pick it up, nothing happening 5 pts
Good design principles used 10 pts
Total 100 pts

Find Phase 1 here

Find Phase 2 here

Find Phase 4 here

Find Phase 5 here