Adventure

Calvin (Deutschbein)

W13Mon: 18 Nov

Announcements

  • Enigma Ongoing
    • You should have at least everything but rotation by now.
    • Finish on time, new project is out today: Adventure.
    • Advising time Click

Last TeachingMachine Ideas

  • Recall Teaching Machine:
    • It reads files
    • It prompts users for input
    • It provides new prompts based on the input
    • It uses classes (like question) and objects of classes (like question no. 2)

Teaching the Adventure

  • The TeachingMachine program can process and run any data file that has the correct format
    • Does not need to technically be a series of educational questions
    • This is part of the strength of the data driven model: data is easy to change, programs less so
  • Could make a sort of “Choose your own adventure” game out of it!
    • Many "gameplay mechanics" fulfill learning objectives.

Adventure Classes

image/svg+xml Adventure The main program, which gets the program started. AdvRoom Maintains the data structure for each room in the cave. AdvGame Contains the code and data necessary to play the game. AdvItem Maintains the data structure for each item in the game.
 

Milestone 0

  • Adapt the code from the Teaching Machine application so that it uses the class and method names for Adventure
  • Once you finish this milestone, you should be able to wander around a bit in the game

The "SmallRooms.txt" Data File

    OutsideBuilding Outside building You are standing at the end of a road before a small brick building. A small stream flows out of the building and down a gully to the south. A road runs up a small hill to the west. ----- WEST: EndOfRoad UP: EndOfRoad NORTH: InsideBuilding IN: InsideBuilding SOUTH: Valley DOWN: Valley EndOfRoad End of road You are at the end of a road at the top of a small hill. You can see a small building in the valley to the east. ----- EAST: OutsideBuilding DOWN: OutsideBuilding

Milestone 1

  • Implement a visit tracking attribute in each room.
  • Check this flag in the code that describes a room to know which description to show
  • Can either write getters and setter or write a method in AdvRoom that manages visit tracking and then prints the appropriate description.

Milestone 2

  • Implement the QUIT, HELP, and LOOK commands
  • Adds extra commands that let the player do more than just move.
  • We need commands latter to do interesting things (manage items)


Milestone 3

  • Implement the "AdvItem" class
  • Implement the methods in the "AdvRoom" class that make it possible to keep track of the objects in a room
  • In the "AdvGame" class, write the code to put each object in its initial room (ignoring the "PLAYER" initial location for now)
  • Change the code for displaying a room so that it displays a list of the objects in the room as well:


The SmallObjects data file

    KEYS a set of keys InsideBuilding LAMP a brightly shining brass lamp BeneathGrate ROD a black rod with a rusty star DebrisRoom WATER a bottle of water PLAYER

Milestone 4

  • Implement the TAKE, DROP, and INVENTORY commands and any code you need to remember what the player is carrying


Milestone 5

  • Implement synonym processing so that the player can use abbreviated forms of the directions and alternative names for the objects


The SmallSynonyms.txt data file

    N=NORTH S=SOUTH E=EAST W=WEST U=UP D=DOWN Q=QUIT L=LOOK I=INVENTORY CATCH=TAKE RELEASE=DROP BOTTLE=WATER

Milestone 6

  • Implement locked passages, which are passages that require a particular object to use
  • Making this change using lists to manage possible next rooms given a direction.
  • There are many ways to solve this problem!


The SmallRooms.txt data file

    OutsideGrate Outside grate You are in a 20-foot depression floored with bare dirt. Set into the dirt is a strong steel grate mounted in concrete. A dry streambed leads into the depression from the north. ----- NORTH: SlitInRock UP: SlitInRock DOWN: BeneathGrate/KEYS DOWN: MissingKeys MissingKeys - The grate is locked and you don't have any keys. ----- FORCED: OutsideGrate

Milestone 7

  • Implement forced motion, in which the player is forced to immediately move from a room to a new room without issuing a command
    • Indicated by the verb FORCED
  • Implementation of forced motion needs to allow some forced passages to still be locked


Announcements

  • Enigma Ongoing
    • You should have at least everything but rotation by now.
    • Finish on time, new project is out today: Adventure.