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

    +

    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 intotemplates/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 `