-
Notifications
You must be signed in to change notification settings - Fork 1
Handy Dandy Guide to Locations and Connections
-
Type in the game variable:
game_variable
Example:
game -
Add the new_location command to it:
game_variable**.new_location()**
Example:
game.new_location() -
Add the name of the location in double quotes:
game_variable.new_location("Name of Location")
Example:
game.new_location("Sidewalk") -
Add the description of the location in double quotes (don't forget the comma):
game.new_location("Name of Location", "Description of the location")
Example:
game.new_location("Sidewalk", "You are outside on a sidewalk. There is a large glass door to the east.") -
Store your new location in a variable:
location_variable = game.new_location("Name of Location","Description of the location")
Example:
sidewalk = game.new_location("Sidewalk", "You are outside on a sidewalk. There is a large glass door to the east.")
-
Type in the game variable:
game_variable
Example:
game -
Add the new_connection command:
game_variable**.new_connection()**
Example:
game.new_connection() -
Add the name of the connection:
game_variable.new_connection("Name of the Connection")
Example:
game.new_connection("Front Door") -
Add the location variable where the connection starts (the "from")
game_variable.new_connection("Name of the Connection", from_location_variable)
Example:
game.new_connection("Front Door", sidewalk) -
Add the location variable where the connection end (the "to")
game_variable.new_connection("Name of the Connection", from_location_variable**, to_location_variable**)
Example:
game.new_connection("Front Door", sidewalk, vestibule) -
Add the direction for going from the start location to the end location (like IN or NORTH):
game.new_connection("Name of the Connection", name_of_a_location_variable, name_of_a_location_variable**, DIRECTION**)
Example:
game.new_connection("Front Door", sidewalk, vestibule, IN) -
Add the reverse direction (the direction for going from the end location to the start location:
game.new_connection("Name of the Connection", from_location_variable, to_location_variable, DIRECTION**, REVERSE_DIRECTION**)
Example:
game.new_connection("Front Door", sidewalk, vestibule, IN, OUT) -
Store the new connection in a variable:
connection_variable = game.new_connection("Name of the Connection", from_location_variable, to_location_variable, DIRECTION, REVERSE_DIRECTION)
Example:
front_door = game.new_connection("Front Door", sidewalk, vestibule, IN, OUT) -
One other thing. Those square brackets [] around the directions:
Square brackets are used for directions when you want to be able to type two different directions to go to the same place. So, you could type IN to go into a building. Or EAST to go into the same building. To make a connection have two directions go to a single location:
connection_variable = game.new_connection("Name of the Connection", from_location_variable, to_location_variable, [DIRECTION1, DIRECTION2], [REVERSE_DIRECTION1, REVERSE_DIRECTION2])
Example:
front_door = game.new_connection("Front Door", sidewalk, vestibule, [IN, EAST], [OUT, WEST])
Note that where just IN used to be as the fourth piece of info needed by new_connection(), there is now [IN, EAST] as that fourth piece of information.
-
Type in the game variable:
game_variable
Example:
game -
Use the new_player command:
game**.new_player()**
Example:
game.new_player() -
Add a location variable:
game.new_player(location_variable)
Example:
game.new_player(sidewalk) -
Store the new player in a variable:
player_variable = game.new_player(location_variable)
Example:
player = game.new_player(sidewalk)