From 7602b18046b8af19a06af8ead2aab4b46cc9b124 Mon Sep 17 00:00:00 2001
From: Gregg Tavares
Date: Fri, 28 Aug 2015 18:21:29 +0100
Subject: [PATCH] update docs
---
docs/api-versions.html | 3 +
docs/api-versions.md | 7 ++
docs/packagejson.html | 81 ++++++++++-------
docs/packagejson.md | 195 ++++++++++++++++++++++++-----------------
4 files changed, 172 insertions(+), 114 deletions(-)
diff --git a/docs/api-versions.html b/docs/api-versions.html
index 1be07ce6..b424ad9c 100644
--- a/docs/api-versions.html
+++ b/docs/api-versions.html
@@ -392,6 +392,9 @@ Talking between games
"instuctionsPosition": "bottom"
to the happyFunTimes
section of your
package.json
file to set it per game. The default is top.
+Added happyFunTimes.templateFileOptions
+See docs
+
diff --git a/docs/api-versions.md b/docs/api-versions.md
index 22af4292..bbe27b8a 100644
--- a/docs/api-versions.md
+++ b/docs/api-versions.md
@@ -366,3 +366,10 @@ the correct version
or `top` to set the position of the instructions. You can also add
`"instuctionsPosition": "bottom"` to the `happyFunTimes` section of your
`package.json` file to set it per game. The default is top.
+
+ * Added `happyFunTimes.templateFileOptions`
+
+ [See docs](packagejson.md#-happyfuntimes-templatefileoptions-)
+
+
+
diff --git a/docs/packagejson.html b/docs/packagejson.html
index 0862e1c5..f132f0dd 100644
--- a/docs/packagejson.html
+++ b/docs/packagejson.html
@@ -73,16 +73,16 @@ Package.json
No trailing commmas.
Good
- {
- "a": 123,
- "b": 456
-
}
-Bad
- {
- "a": 123,
- "b": 456,
-
}
-
+
{
+ "a": 123,
+ "b": 456
+}
+
Bad
+{
+ "a": 123,
+ "b": 456,
+}
+
No comments! JSON is NOT JavaScript.
All Strings and identifiers must be quoted with double quotes. The only things not quoted are numbers and true
, false
,
@@ -108,26 +108,20 @@
Required fields
"minPlayers": 1
}
}
-
-name
+name
A name for your game. Used on the main screen of HappyFunTimes and SuperHappyFunTimes
-
-description
+description
A description. Used on superhappyfuntimes. No HTML allowed currently.
-
-version
+version
Used on superhappyfuntimes so users can know if there is a newer version for them to download.
-
-happyFunTimes.gameId
+happyFunTimes.gameId
This is the id for your game. Every game on superhappyfuntimes must have a unique id.
only A-Z, 0-9, _, - are allowed and no more than 60 charactera.
-
-happyFunTimes.apiVersion
+happyFunTimes.apiVersion
This is the happyFunTimes API version needed by this game. If this number is higher
than the version of happyFunTimes the user has installed they will be asked to upgrade.
It is also used by happyFunTimes to provide the correct API for the game.
-
-happyFunTimes.gameType
+happyFunTimes.gameType
This is used by happyFunTimes to figure out how to deal with the game. For example
how to launch the game and how to publish it.
Valid values are
@@ -136,15 +130,13 @@ Required fields
Unity3D
Unity3DLibrary
-
-happyFunTimes.minPlayers
+happyFunTimes.minPlayers
How many players are required to play this game. For example, jumpjump you can play with
one player. It's probably not any fun but you can player. boomboom on the otherhand
requires 2 players. It will not start until there are 2 players.
This is only used on the superhappyfuntimes to set expectations. If you have a game that requires
10 players please consider marking it here.
-
-happyFunTimes.category
+happyFunTimes.category
This is also only used on superhappyfuntimes to set expections and hopefully to, um, categories
things. Current values
@@ -152,12 +144,11 @@ Required fields
example
Not a game, not really meant to be played, just an example
demo
Not a game, something else like an exhibit, possibly not playable without more stuff
-
-happyFunTimes.useScriptTag
+happyFunTimes.useScriptTag
True indicates you don't want to use requirejs instead you want to use <script>
tags. Your apiVerison
must be 1.3.0
or higher
I really like require.js style of modules. It encourages
-dependency injection, it also suppots module independence. But, for many it's non
+dependency injection, it also supports module independence. But, for many it's non
standard and they're not used to it.
So, if you want to just use standard script tags make sure your package.json
has its
happyFunTimes.apiVersion
set to 1.3.0
or higher and add the flag happyFunTimes.useScriptTag
set
@@ -178,8 +169,7 @@
Required fields
either game.html
or controller.html
. The HappyFunTimes libraries will be inserted before
those tags. The game.js
or controller.js
will be inserted after.
See example: http://github.com/hft-simple-script/
-
-'happyFunTimes.ignore`
+happyFunTimes.ignore
Used to prevent certainly files from being part of the published game.
This is an array of strings in the format of .gitignore
(see git docs)
not including the double asterix syntax. So for example
@@ -195,8 +185,33 @@ Required fields
}
}
would exclude the <projectdir>/src
folder as well as any photoshop files.
-
-
+happyFunTimes.templateFileOptions
+requires apiVersion 1.15.0
or higher.
+by default game.html
automatically gets inserted into templates/game.gameview.html
.
+'controller.htmlautomatically gets inserted into
templates/controller.index.html`.
+If your project needs other files to be treated similarly you can use this option. A good example
+is Tonde-Iko. Its game.html
is just a menu for
+debugging, testing, and lanching individual screens. The game itself is run from realgame.html
.
+There's also a network stress test in stress.html
and a file that creates the controller avatar
+texture atlas in makeimage.html
.
+Each of those needed the templating treatment to get the happyfuntimes support libraries etc so
+this was added to the package.json
+{
+ "name": "Tonde-Iko",
+ ...
+ "happyFunTimes": {
+ "gameId": "tonde-iko",
+ ...
+ "templateFileOptions": [
+ { "filename": "realgame.html", "template": "game" },
+ { "filename": "stress.html", "template": "game" },
+ { "filename": "makeimage.html", "template": "game" }
+ ]
+ }
+}
+
That basically says for those 3 files use the game
template. They will automatically use
+their respective scripts and css so for example realgame.html
uses scripts/realgame.js
+and css/realgame.css
diff --git a/docs/packagejson.md b/docs/packagejson.md
index 44b394af..5652f5aa 100644
--- a/docs/packagejson.md
+++ b/docs/packagejson.md
@@ -10,17 +10,17 @@ This file defines some data about your game. It is a JSON file and JSON has a ve
Good
- {
- "a": 123,
- "b": 456
- }
+ {
+ "a": 123,
+ "b": 456
+ }
Bad
- {
- "a": 123,
- "b": 456,
- }
+ {
+ "a": 123,
+ "b": 456,
+ }
* No comments! JSON is NOT JavaScript.
@@ -49,109 +49,142 @@ A standard package.json looks like this
}
}
-* `name`
+#### `name`
- A name for your game. Used on the main screen of HappyFunTimes and SuperHappyFunTimes
+A name for your game. Used on the main screen of HappyFunTimes and SuperHappyFunTimes
-* `description`
+#### `description`
- A description. Used on superhappyfuntimes. No HTML allowed currently.
+A description. Used on superhappyfuntimes. No HTML allowed currently.
-* `version`
+#### `version`
- Used on superhappyfuntimes so users can know if there is a newer version for them to download.
+Used on superhappyfuntimes so users can know if there is a newer version for them to download.
-* `happyFunTimes.gameId`
+#### `happyFunTimes.gameId`
- This is the id for your game. Every game on superhappyfuntimes must have a unique id.
- only A-Z, 0-9, _, - are allowed and no more than 60 charactera.
+This is the id for your game. Every game on superhappyfuntimes must have a unique id.
+only A-Z, 0-9, _, - are allowed and no more than 60 charactera.
-* `happyFunTimes.apiVersion`
+#### `happyFunTimes.apiVersion`
- This is the happyFunTimes API version needed by this game. If this number is higher
- than the version of happyFunTimes the user has installed they will be asked to upgrade.
- It is also used by happyFunTimes to provide the correct API for the game.
+This is the happyFunTimes API version needed by this game. If this number is higher
+than the version of happyFunTimes the user has installed they will be asked to upgrade.
+It is also used by happyFunTimes to provide the correct API for the game.
-* `happyFunTimes.gameType`
+#### `happyFunTimes.gameType`
- This is used by happyFunTimes to figure out how to deal with the game. For example
- how to launch the game and how to publish it.
+This is used by happyFunTimes to figure out how to deal with the game. For example
+how to launch the game and how to publish it.
- Valid values are
+Valid values are
- * `html`
- * `Unity3D`
- * `Unity3DLibrary`
+* `html`
+* `Unity3D`
+* `Unity3DLibrary`
-* `happyFunTimes.minPlayers`
+#### `happyFunTimes.minPlayers`
- How many players are required to play this game. For example, jumpjump you can play with
- one player. It's probably not any fun but you can player. boomboom on the otherhand
- requires 2 players. It will not start until there are 2 players.
+How many players are required to play this game. For example, jumpjump you can play with
+one player. It's probably not any fun but you can player. boomboom on the otherhand
+requires 2 players. It will not start until there are 2 players.
- This is only used on the superhappyfuntimes to set expectations. If you have a game that requires
- 10 players please consider marking it here.
+This is only used on the superhappyfuntimes to set expectations. If you have a game that requires
+10 players please consider marking it here.
-* `happyFunTimes.category`
+#### `happyFunTimes.category`
- This is also only used on superhappyfuntimes to set expections and hopefully to, um, categories
- things. Current values
+This is also only used on superhappyfuntimes to set expections and hopefully to, um, categories
+things. Current values
- * `game` A game
- * `example` Not a game, not really meant to be played, just an example
- * `demo` Not a game, something else like an exhibit, possibly not playable without more stuff
+* `game` A game
+* `example` Not a game, not really meant to be played, just an example
+* `demo` Not a game, something else like an exhibit, possibly not playable without more stuff
-* `happyFunTimes.useScriptTag`
+#### `happyFunTimes.useScriptTag`
- True indicates you don't want to use requirejs instead you want to use `