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_pic

Getting Started with the Code

First, copy the code from the following directory: ~csci204/2019-fall/student/projects/p2Dancy/
We have provided an executable prototype of the game. You should see the following set of files in your project folder:

The Point class

The GUI makes use of a Point class - a basic data structure that simply holds an x and y attribute. This class is used in the get_rover_location() and get_image() methods.

class Point:
  def __init__(self, x, y):
    self.x = x
    self.y = y

Existing Functions (Game.py):

There are a lot more methods that you'll eventually need to complete as we progress through the game development.


Phase 1: Rover Movement

The goal of part 1 is to focus on your class design and to build movement into the system.

Overview

Configuration Details

OOP Design

Although the design is largely up to you this time, think carefully about how you will structure your program. We are going to progressively expect better design from you each project, and a portion of your grade will be based on this design. Here are a few things to consider

Think carefully about the relationships between these objects. This is the hard part of design! But if you do it right, it will make all your future parts go much smoother.


Phase 2: An Infinite Universe

The universe is infinite. This means that you could constantly walk through portals into new rooms. The objective of phase 2 is to make the portal system functional.

Portals

Portals are inter-dimensional doorways to other rooms. If the rover steps on a portal, it must go through the portal. It will arrive on a portal in another room (and not get sucked back through until it steps off and on again).

Implementation Hints


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

Phase 4: Finding the Way Back Home

As your rover travels deep into this barren world filled with both vast desert landscapes and delicious cake, it's likely that you will get lost. How do you find your way back to your ship? To help the rover, you'll implement the Way Back button. Whenever this button is hit, the room's portal that contains a path to your ship will change color. This will allow you to always get back to your ship.

Notes and Constraints

Implementation

Whenever you have to develop a feature that allows users retrace their steps (either in a browser with the back button or ann app with an undo button), your mind should jump to using a Stack. Think carefully about how you should use a Stack in your program to recover the rover's way back home.

We are intentionally leaving these details open for interpretation. It's up to you to decide the way to make your program functional. Don't forget to do lots of testing!


Phase 5: Completing the Game

This is the final section of the project: Your Rover is in a race against time to fix the ship. You must collect items across the Martian landscape to repair your ship. However, as time passes in the brutal climate, more things go wrong, leaving you with more things to fix before you can get off the planet. If you aren't quick enough at repairing your ship, you may find yourself permanently stuck on Mars.

Your objectives:

Think about what new classes (if any) that you should create to fulfill these goals. Design matters! Don't have a class do too much!

Task Generation

Tasks are shown as a string in the task field of the GUI (much like the inventory):

Broken Engine! To fix the engine, you will need:
- 3 Screws
- 2 Cakes
- 1 Cabbage

About Tasks

Storing Tasks in a Queue

Fixing Your Ship

Creativity

For the last 10% of your grade, you are encouraged to augment your project in any way that you'd like. No matter what you do you must include a README.txt file describing your functionality.

We will roughly use the following guide to grade creativity: