GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codeuniversity/code-world: A small text adventure started in SE_01 and expanded upon by the community.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
locations
locations
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
main.py
main.py
 
 

Repository files navigation

CODE World Campus

A silly little text adventure.

Adding a location

Locations are organized in files. Each location is its own file.

You can add a location by following these steps:

  1. Add a file in the /locations directory.
  2. The file must include a variable defining a dictionary. That dictionary must follow the following structure:
location_variable = {
  "USER_INPUT": {
    "output": function_name,
    "next_location_id": None
  }
}

Replace the location_variable with a unique name.

For each possible user input, add a dictionary. The dictionary must have a output and next_location_id value.

The output should be assigned a function and return a string to display to the user.

The next_location_id should be any ID available in the locations dictionary in the main.py file if the user in put should change the location to that place. Use None if the location should not be changed.

Define a "fallback" as USER_INPUT for one of the dictionaries to catch all not-matched user inputs.

Once the room is defined:

  1. Import the room's dictionary variable in the main.py file.
  2. Give the location an ID and define it as key in the locations variable of the main.py file. Reference the imported room to that key (see other rooms as example).
  3. Ensure your room is accessible from anywhere in the existing game by adding its ID string (defined above) as next_location_id to another room.

About

A small text adventure started in SE_01 and expanded upon by the community.

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.