From 64cac6f78a3a6cf94dbb11f8e527e3417c6fabf7 Mon Sep 17 00:00:00 2001 From: Happy Date: Fri, 6 Aug 2021 19:45:51 -0700 Subject: [PATCH] Replace em spaces with regular spaces in readme and add syntax highlighting --- readme.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/readme.md b/readme.md index 438d32c..0211389 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,15 @@ ``` - ████████ ███████ ██  ██ ████████  -    ██    ██       ██ ██     ██     - ██  █████   ███   ██  █████  - ██  ██     ██ ██  ██        - ██  ███████ ██   ██  ██  -                         -███████ ███  ██  ██████  ██ ███  ██ ███████  -██      ████  ██ ██       ██ ████  ██ ██       -█████  ██ ██  ██ ██  ███ ██ ██ ██  ██ █████  -██     ██  ██ ██ ██  ██ ██ ██  ██ ██ ██     -███████ ██   ████  ██████  ██ ██   ████ ███████ + ████████ ███████ ██ ██ ████████ + ██ ██ ██ ██ ██ + ██ █████ ███ ██ █████ + ██ ██ ██ ██ ██ + ██ ███████ ██ ██ ██ + +███████ ███ ██ ██████ ██ ███ ██ ███████ +██ ████ ██ ██ ██ ████ ██ ██ +█████ ██ ██ ██ ██ ███ ██ ██ ██ ██ █████ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +███████ ██ ████ ██████ ██ ██ ████ ███████ ``` An HTML-based text adventure game engine. Small and easy to use with no dependencies. Highly customizable. @@ -148,11 +148,11 @@ You can use the included [index.html](https://github.com/okaybenji/text-engine/b Sometimes you just want to start from scratch. If you wish to make your own HTML file, just be sure it contains the following two elements: * A `div` with ID `output`. This is where the game text will appear. -``` +```html
``` * An `input` with ID `input`. This is where the player will enter commands. -``` +```html ``` @@ -261,7 +261,7 @@ Methods are named according to what the player types to issue them. For instance Here are a few examples of ways to override the default commands: -``` +```js // Add a command which takes no arguments. // In this example, the command is called "play", and the user would type "play" to use the command. const play = () => println(`You're already playing a game!`); @@ -303,7 +303,7 @@ If you are writing functions for your game, you'll need to keep these in mind as * Functions attached to the disk must not rely on [closures](https://medium.com/javascript-scene/master-the-javascript-interview-what-is-a-closure-b2f0d2152b36). Closures are lost when a JSON object is converted to a string representation. * You cannot use the [shorthand syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) for defining methods. That is, -``` +```js { onUse() { // This version will not work.