|
-- index |
|
|
|
In the last Brooklyn.js Byron Hulcher talked about how to make video games with Twine. |
|
Today I'd like to talk about how to make video games with gist-txt. |
|
|
|
-- 01 |
|
-- What is gist-txt? |
|
|
|
gist-txt is an adventure game engine that I built mainly because I didn't like to use a desktop application to build my own adventure games. |
|
|
|
It all started when I knew about the AdventureJam. |
|
|
|
The AdventureJam is a game jam where you have two weeks to build an adventure game. |
|
|
|
-- 02 |
|
-- Adventure games |
|
|
|
I've always liked adventure games. |
|
|
|
It all started with The Secret of Monkey Island. |
|
Did you ever tried playing with that game? It's awesome. |
|
|
|
-- 03 |
|
-- Text adventures |
|
|
|
But in the beginning (late '70, early '80) there were text adventures like *Zork*. |
|
|
|
Actually I never enjoyed playing with such kind of games. |
|
|
|
You must type things in a command line, like "go north" or "open the door". |
|
|
|
I get bored easily to insert commands that don't get recognized from the parser. |
|
|
|
-- 04 |
|
-- Twine |
|
|
|
At this point I discovered that you can easily build text adventures by only writing HTML documents, and that's when I learnt about Twine. |
|
|
|
Twine is a desktop app that let's you create text adventures by simply connecting boxes full of text. |
|
|
|
Well, right now it's also a web application, but I wanted to build my game with my own rules. |
|
|
|
-- 05 |
|
-- What I wanted |
|
|
|
I wanted to write markdown. |
|
I wanted to edit it easily, to collaborate with my friends. |
|
I wanted to use standard tools like javascript to add little features. |
|
I wanted to share it with one click, without worrying about hosting. |
|
|
|
-- 06 |
|
-- gist-txt |
|
|
|
gist-txt was born. |
|
|
|
It compiles and renders markdown. |
|
It uses gists as a datastore. |
|
It runs JS to let you override default behaviors. |
|
It lets you share a simple link to publish your game. |
|
|
|
-- 07 |
|
-- Step 1 |
|
|
|
Create a gist with a file named index.markdown in it. |
|
|
|
This will be the initial scene. |
|
|
|
-- 08 |
|
-- Step 2 |
|
|
|
Create another file called cave.markdown. |
|
|
|
Every markdown file that you create in your gist is going to be a different scene of your game. |
|
|
|
-- 09 |
|
-- Step 3 |
|
|
|
Add a link between the two scenes. |
|
|
|
Links are markdown links without the .markdown extension. |
|
|
|
In this case a link to the "cave" scene would be something like: [Explore the cave](cave) |
|
|
|
-- 10 |
|
-- Step 4 |
|
|
|
Publish your game. |
|
|
|
Well, it's already public! |
|
|
|
Just share the link http://potomak.github.com/gist-txt#<gist-id> and you're done. |
|
|
|
-- 11 |
|
-- Step 5 (optional) |
|
|
|
Add some style. |
|
|
|
You can customize the style of your adventure game by adding a "style.css" file to the gist. |
|
|
|
-- 12 |
|
-- Step 6 (optional) |
|
|
|
Game state. |
|
|
|
You can react to events in your game using a global "state" variable that is accessible through mustache tags. |
|
|
|
You can add a "treasure: true" state to the cave scene and react to that state in the index scene to show or hide a text paragraph. |
|
|
|
Example: {{#treasure}}You're rich!{{/treasure}} |
|
|
|
-- 13 |
|
-- Routine |
|
|
|
Right now there's only one game built and published with this tool, it's called Routine, and you can play it at http://j.mp/play-routine |
|
|
|
I built it with help from Daniel, Luca, and Francesco, some friends of mine, and it's attending the AdventureJam competition. |
|
|
|
-- 14 |
|
-- Help wanted |
|
|
|
The project is brand new and there's still a lot of things to do. |
|
|
|
If you have some spare time and you want to collaborate on a simple JS project, take a look at its github repo page at http://github.com/potomak/gist-txt |
|
|
|
-- 15 |
|
-- Thanks |