Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: swansontec/EverText
base: 70e3777a58
...
head fork: swansontec/EverText
compare: 49c2b566c4
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 16 additions and 16 deletions.
  1. +16 −16 EverText.js
View
32 EverText.js
@@ -1,10 +1,10 @@
/**
-* EverText
-*/
+ * EverText (Now with lie-free cake!)
+ */
/**
-* Call this function to put HTML into the output box:
-*/
+ * Call this function to put HTML into the output box:
+ */
function textOut(text)
{
var p = document.createElement("p");
@@ -17,8 +17,8 @@ function textOut(text)
}
/**
-* Display a welcome message.
-*/
+ * Display a welcome message.
+ */
function gameWelcome() {
textOut('<img alt="Welcome to EverText" src="welcome.png">');
gameCommand('look');
@@ -26,8 +26,8 @@ function gameWelcome() {
window.onload = gameWelcome;
/**
-* Handle when the user presses "enter"
-*/
+ * Handle when the user presses "enter"
+ */
function gameSubmit()
{
//Get the text they entered:
@@ -46,8 +46,8 @@ function gameSubmit()
}
/**
-* Handles default command behavior.
-*/
+ * Handles default command behavior.
+ */
function gameCommand(input)
{
var here = places[game.location];
@@ -154,8 +154,8 @@ function gameCommand(input)
}
/**
-* This is the player's inventory:
-*/
+ * This is the player's inventory:
+ */
var game = {
"location": "start",
"score": 0,
@@ -168,8 +168,8 @@ var game = {
};
/**
-* These are the places the player can go:
-*/
+ * These are the places the player can go:
+ */
var places = {
"start": {
"text": "You find yourself on an island. A cool breeze is blowing from the ocean, and palm trees line a sandy road heading from <em>east</em> to <em>west</em>.",
@@ -202,8 +202,8 @@ var places = {
};
/**
-* Custom game logic.
-*/
+ * Custom game logic.
+ */
function doGame(input)
{
//Handle special actions at certain locations:

No commit comments for this range

Something went wrong with that request. Please try again.