Giter Site home page Giter Site logo

git-adventure-game-builder's Introduction

git-adventure

A text-based adventure game helping players learn about git along the way.

This document describes how the text-based adventure system that for Git will work. It supports Git on the command line, both on Windows CMD and Windows Git Bash as well as shell under Unix based systems.

Building up a world

Each level in the game is identified by a branch. Branch names must be formatted as: <level_number>_<level_short_name>, for example: 01_look_into_the_past. The branch name is used to identify the level the user is on, display the correct puzzle information and use the correct solution checking.

Each level consists out of 5 files. The files are named, prefixed by the level name:

  • <lvl>_check.txt - Contains the puzzle solution checking code.
  • <lvl>_hint.txt - Contains a hint about how to solve the puzzle. Each level can define as many hint files as needed (<lvl>_hint2.txt, <lvl>_hint3.txt ... , <lvl>_hintN.txt).
  • <lvl>_room.txt - Contains a general description about the puzzle. This is displayed to the player when they enter the level.

Lastly, the level must also be recorded in the .game_data/levels.txt file which contains all of the level names (branch names), one per line. Ensure that this file contains a trailing blank line.

During development, all this information is stored on the master git-adventures repository and a special script may be used to generate the pristine repository. See Building the Repository.

If your level requires specific setup during repository creation, you can place additional commands into .game_data/<lvl>_setup.sh. This script will be called with two parameters: The source folder where the git-adventure master repo is located, and the target folder where the branch is being setup. The script may assume that the target folder is already in the target branch and no changes to the git state in the target folder should be made. All new files will automatically be added to the git repo.

Scripted commands

The following 'commands' are provided as scripts in order to help the player navigate the game:

  • './look' - Tells you about your surroundings and the predicament you find yourself in. Displays the content of the <lvl>_room.txt file.
  • './hint' - Provides you with some help, perhaps an indication of how to solve the problem. Displays the content of the <lvl>_hint{n}.txt file. The command may be called multiple times, cycling through the number of hint files provided.

Some further commands we may want to potentially provide:

  • './map' - Some textual representation of the world to give the weary traveler a bit more of an idea of the long-term strategies, goals.
  • './reset' - I've messed everything up. Help me get back to the start of the current level.

Ephemeral State

The .gitignore file contains .game_data/state and this folder can be used to keep ephemeral game state such as score. Which files and what the format to be used is still undecided at this time.

Building the Repository

To test the final repo, execute the following:

./setup_clean_repo -o <target_folder>

Then clone the new pristine repository so that we can see what the user would see:

git clone <target_folder> <test_folder>

In order to play the game from the beginning:

./start_game

In order to playtest a specific level, the following command can be executed to go to that specific level:

git checkout -b <lvl> origin/<lvl>

Publish the Repository

Let's say you created the game repo and you are happy with it.

./setup_clean_repo -o ../great_game

You can now publish it via:

GIT_GAME=https://github.com/bloomberg/git-adventure-game.git
$ ./publish_game ../great_game ${GIT_GAME}

Open Issues

  • How to ensure that local tracking branches are not automatically created
  • Branches to set visible when a level is passed.

git-adventure-game-builder's People

Contributors

alfareyouthere avatar hkleynhans avatar letubert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

git-adventure-game-builder's Issues

cygpath: command not found error

Hi git-adventure-game-builder developer,

I tried to launch the game using ./start_game.bat, but I am getting below error.
guess this occurs when a fresh git-clone checkout is performed.

image

Thanks,
Kevin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.