Skip to content

Commit a20762c

Browse files
authored
update links in readme to point to new main branch
1 parent 87728fe commit a20762c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ An HTML-based text adventure game engine. Small and easy to use with no dependen
1717
Very little programming is required, but several JavaScript hooks are provided if you are inclined to use them!
1818

1919
### How do I use it?
20-
To create your own adventure, you can use one of the files in the [game-disks](https://github.com/okaybenji/text-engine/blob/master/game-disks) folder as a template. For example, take a look at [the disk called newDiskTemplate](https://github.com/okaybenji/text-engine/blob/master/game-disks/new-disk-template.js).
20+
To create your own adventure, you can use one of the files in the [game-disks](https://github.com/okaybenji/text-engine/blob/main/game-disks) folder as a template. For example, take a look at [the disk called newDiskTemplate](https://github.com/okaybenji/text-engine/blob/main/game-disks/new-disk-template.js).
2121

22-
Include your "game disk" (a function returning JSON data) in index.html and load it with `loadDisk(myGameData)`. (Look at [index.html](https://github.com/okaybenji/text-engine/blob/master/index.html) in the repo for an example.)
22+
Include your "game disk" (a function returning JSON data) in index.html and load it with `loadDisk(myGameData)`. (Look at [index.html](https://github.com/okaybenji/text-engine/blob/main/index.html) in the repo for an example.)
2323

2424
The end product will be your very own text adventure game, similar to [this one](http://okaybenji.github.io/text-engine). It's a good idea to give that game a try to get introduced to the engine.
2525

2626
![Demo Screenshot](screenshot.gif "Demo Screenshot")
2727

2828
`text-engine` uses a disk metaphor for the data which represents your game, like the floppy disks of yore.
2929

30-
Including [index.js](https://github.com/okaybenji/text-engine/blob/master/index.js) from this repository in your [index.html](https://github.com/okaybenji/text-engine/blob/master/index.html) `<script>` adds a several functions to the global namespace. One of these is called `loadDisk`. `loadDisk` accepts a single argument, which is your disk -- a function returning a JavaScript object (JSON).
30+
Including [index.js](https://github.com/okaybenji/text-engine/blob/main/index.js) from this repository in your [index.html](https://github.com/okaybenji/text-engine/blob/main/index.html) `<script>` adds a several functions to the global namespace. One of these is called `loadDisk`. `loadDisk` accepts a single argument, which is your disk -- a function returning a JavaScript object (JSON).
3131

3232
## Disks
3333
A disk is a function which returns a JavaScript object that describes your game. At minimum, that object must have these two top-level properties:
@@ -137,11 +137,11 @@ Topics can have these other optional properties as well:
137137
That's everything! If you've made a JSON object with a `roomId` and a list of `rooms` -- that is, a disk -- you've got a playable game!
138138

139139
### How do I play it?
140-
Just pass a reference to your disk to the loadDisk function. Take a look at [index.html](https://github.com/okaybenji/text-engine/blob/master/index.html) to see an example.
140+
Just pass a reference to your disk to the loadDisk function. Take a look at [index.html](https://github.com/okaybenji/text-engine/blob/main/index.html) to see an example.
141141

142-
I've saved my disk to a `const` variable called `demoDisk` in [game-disks/demo-disk.js](https://github.com/okaybenji/text-engine/blob/master/game-disks/demo-disk.js). I've included that file and `index.js` in my HTML file, and added a script tag with a single line to call `loadDisk(demoDisk)`. The game boots when [index.html](https://github.com/okaybenji/text-engine/blob/master/index.html) is loaded in a web browser.
142+
I've saved my disk to a `const` variable called `demoDisk` in [game-disks/demo-disk.js](https://github.com/okaybenji/text-engine/blob/main/game-disks/demo-disk.js). I've included that file and `index.js` in my HTML file, and added a script tag with a single line to call `loadDisk(demoDisk)`. The game boots when [index.html](https://github.com/okaybenji/text-engine/blob/main/index.html) is loaded in a web browser.
143143

144-
You can use the included [index.html](https://github.com/okaybenji/text-engine/blob/master/index.html) file in your own project, or you can create your own.
144+
You can use the included [index.html](https://github.com/okaybenji/text-engine/blob/main/index.html) file in your own project, or you can create your own.
145145

146146
#### Making your own HTML file
147147

@@ -257,7 +257,7 @@ Every command a player can issue in the game has a corresponding function in tex
257257

258258
For instance, there's a function called "go" that gets called when the player types GO.
259259

260-
You can add your own custom commands as well. Take a look at [the "unlock" command in game-disks/demo-disk.js](https://github.com/okaybenji/text-engine/blob/master/game-disks/demo-disk.js#L478-L495) for an example.
260+
You can add your own custom commands as well. Take a look at [the "unlock" command in game-disks/demo-disk.js](https://github.com/okaybenji/text-engine/blob/main/game-disks/demo-disk.js#L478-L495) for an example.
261261

262262
#### Overriding the default command set
263263
If existing commands don't work how you want them to, you can override them by reassigning them to your own function code.
@@ -292,7 +292,7 @@ commands = [{walk: () => println(‘you walk’), talk: () => println(‘you tal
292292
If you do remove some or all of the default commands, you'll want to override the `help` function as well so that it doesn't list commands which are not supported by your game.
293293

294294
### Other Functions
295-
There are several other functions available in the engine! Feel free to take a peek at the [source code](https://github.com/okaybenji/text-engine/blob/master/index.js). It's designed to be open and simple to use and to customize.
295+
There are several other functions available in the engine! Feel free to take a peek at the [source code](https://github.com/okaybenji/text-engine/blob/main/index.js). It's designed to be open and simple to use and to customize.
296296

297297
### A word of caution regarding SAVE/LOAD
298298
The default implementation of saving and loading games in text-engine is quite simple. All the commands a player has entered are stored in the save to be "played back" into the game in the same order on load. It's something like the game playing itself back to the point where you left off, instantaneously.

0 commit comments

Comments
 (0)