Skip to content

Handy Dandy Quick Reference Guide to Everything

sleepinghungry edited this page Jan 17, 2017 · 7 revisions

Handy Dandy Quick Reference Guide to Everything (So Far)

Locations and Connections

Command to create a new location:

######      location_variable = game_variable.new_location("Name of Location","Description of Location")

Example:

      sidewalk = game.new_location("Sidewalk","You are on a paved sidewalk.")

Command to create a new connection:

######      connection_variable = game_variable.new_connection("Name of Connection", from_location_variable, to_location_variable, DIRECTION, REVERSE_DIRECTION) ######      connection_variable = game_variable.new_connection("Name of Connection", from_location_variable, to_location_variable, [DIRECTION1, DIRECTION2], [REVERSE_DIRECTION1, REVERSE_DIRECTION2])

Examples:

      front_door = game.new_connection("Front Door", sidewalk, vestibule, IN, OUT)
      front_door = game.new_connection("Front Door", sidewalk, vestibule, [IN, EAST], [OUT, WEST])

Command to set the location where the game starts:

######      player_variable = game_variable.new_player(location_variable)

Example:

      player = game.new_player(sidewalk)

Items

Command to create a new item:

######      item_variable = location_variable.new_object("item name","item description")

Example:

      key = sidewalk.new_obejct("key","a small silver key")

Command to make an item required somewhere:

######      location_variable.make_requirement(item_variable)
######      connection_variable.make_requirement(item_variable)

Examples:

      office.make_requirement(key)
      office_door.make_requirement(key)

Command to make a new in-game command:

######      item_variable.add_phrase("command", Say("What the game says after you use the game command"))

Example:

      key.add_phrase("rub key", Say("This is not a magic lamp."))

Actors and Animals

Command to create an Actor or Animal:

######      actor_variable = Actor("name of actor")
######      animal_variable = Animal("name of animal")

Examples:

      angry_elf = Actor("angry elf")
      sad_polar_bear = Animal("sad polar bear")

Command to set your new character's starting location

######      actor_or_animal_variable.set_location(location_variable)

Examples:

      angry_elf.set_location(playground)       sad_polar_bear.set_location(upstairs)

Command to set limits on your new character's roaming (animal only)

######      animal_variable.set_allowed_locations([location_variable1, location_variable2, location_variable3])

Example:

      sad_polar_bear.set_allowed_locations([upstairs,vestibule,front])

Command to add a new character to the game

######      game_variable.add_actor(actor_or_animal_variable)

Examples:

      game.add_actor(angry_elf)
      game.add_actor(sad_polar_bear)

Command to add an in-game command for an actor or animal

######      actor_or_animal_variable.add_phrase("command", Say("What the game says after you use the game command"))

Examples:

      angry_elf.add_phrase("chat", Say("The angry elf glares at you."))
      sad_polar_bear.add_phrase("pet bear", Say("The polar bear smiles."))

Command to add an in-game command with many responses:

######      actor_or_animal_variable.add_phrase("command", Say("What the game says after you use the game command"))

Examples:

      angry_elf.add_phrase("chat", Say(["The angry elf glares at you.", "The angry elf snorts in derision.","The angry elf mutters to himself and turns his back on you."]))
      sad_polar_bear.add_phrase("pet bear", Say(["The polar bear smiles sadly.","The polar bear licks your face sadly.","The polar bear closes its eyes sadly and dreams of playing in the snow."]))

BWX Game Engine pages

Python Pages

Step By Step Guides

Building Conditionals

Lectures

Explaining Conditionals

Assignments

I Am Thinking of a Number...

Clone this wiki locally