Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Aug 28, 2015
1 parent 592b4dd commit 7602b18
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 114 deletions.
3 changes: 3 additions & 0 deletions docs/api-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ <h3 id="talking-between-games">Talking between games</h3>
<code>&quot;instuctionsPosition&quot;: &quot;bottom&quot;</code> to the <code>happyFunTimes</code> section of your
<code>package.json</code> file to set it per game. The default is top.</p>
</li>
<li><p>Added <code>happyFunTimes.templateFileOptions</code></p>
<p><a href="packagejson.html#-happyfuntimes-templatefileoptions-">See docs</a></p>
</li>
</ul>
</li>
</ul>
Expand Down
7 changes: 7 additions & 0 deletions docs/api-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-)



81 changes: 48 additions & 33 deletions docs/packagejson.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ <h1 id="-package-json">Package.json</h1>
<ul>
<li><p>No trailing commmas.</p>
<p>Good</p>
<p> {</p>
<pre><code> &quot;a&quot;: 123,
&quot;b&quot;: 456
</code></pre><p> }</p>
<p>Bad</p>
<p> {</p>
<pre><code> &quot;a&quot;: 123,
&quot;b&quot;: 456,
</code></pre><p> }</p>
</li>
<pre><code>{
&quot;a&quot;: 123,
&quot;b&quot;: 456
}
</code></pre><p>Bad</p>
<pre><code>{
&quot;a&quot;: 123,
&quot;b&quot;: 456,
}
</code></pre></li>
<li><p>No comments! JSON is NOT JavaScript.</p>
</li>
<li><p>All Strings and identifiers must be quoted with double quotes. The only things not quoted are numbers and <code>true</code>, <code>false</code>,
Expand All @@ -108,26 +108,20 @@ <h3 id="required-fields">Required fields</h3>
&quot;minPlayers&quot;: 1
}
}
</code></pre><ul>
<li><p><code>name</code></p>
</code></pre><h4 id="-name-"><code>name</code></h4>
<p>A name for your game. Used on the main screen of HappyFunTimes and SuperHappyFunTimes</p>
</li>
<li><p><code>description</code></p>
<h4 id="-description-"><code>description</code></h4>
<p>A description. Used on superhappyfuntimes. No HTML allowed currently.</p>
</li>
<li><p><code>version</code></p>
<h4 id="-version-"><code>version</code></h4>
<p>Used on superhappyfuntimes so users can know if there is a newer version for them to download.</p>
</li>
<li><p><code>happyFunTimes.gameId</code></p>
<h4 id="-happyfuntimes-gameid-"><code>happyFunTimes.gameId</code></h4>
<p>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.</p>
</li>
<li><p><code>happyFunTimes.apiVersion</code></p>
<h4 id="-happyfuntimes-apiversion-"><code>happyFunTimes.apiVersion</code></h4>
<p>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.</p>
</li>
<li><p><code>happyFunTimes.gameType</code></p>
<h4 id="-happyfuntimes-gametype-"><code>happyFunTimes.gameType</code></h4>
<p>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.</p>
<p>Valid values are</p>
Expand All @@ -136,28 +130,25 @@ <h3 id="required-fields">Required fields</h3>
<li><code>Unity3D</code></li>
<li><code>Unity3DLibrary</code></li>
</ul>
</li>
<li><p><code>happyFunTimes.minPlayers</code></p>
<h4 id="-happyfuntimes-minplayers-"><code>happyFunTimes.minPlayers</code></h4>
<p>How many players are required to play this game. For example, jumpjump you can play with
one player. It&#39;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.</p>
<p>This is only used on the superhappyfuntimes to set expectations. If you have a game that requires
10 players please consider marking it here.</p>
</li>
<li><p><code>happyFunTimes.category</code></p>
<h4 id="-happyfuntimes-category-"><code>happyFunTimes.category</code></h4>
<p>This is also only used on superhappyfuntimes to set expections and hopefully to, um, categories
things. Current values</p>
<ul>
<li><code>game</code> A game</li>
<li><code>example</code> Not a game, not really meant to be played, just an example</li>
<li><code>demo</code> Not a game, something else like an exhibit, possibly not playable without more stuff</li>
</ul>
</li>
<li><p><code>happyFunTimes.useScriptTag</code></p>
<h4 id="-happyfuntimes-usescripttag-"><code>happyFunTimes.useScriptTag</code></h4>
<p>True indicates you don&#39;t want to use requirejs instead you want to use <code>&lt;script&gt;</code> tags. Your <code>apiVerison</code>
must be <code>1.3.0</code> or higher</p>
<p>I really like <a href="http://requirejs.org">require.js</a> style of modules. It encourages
dependency injection, it also suppots module independence. But, for many it&#39;s non
dependency injection, it also supports module independence. But, for many it&#39;s non
standard and they&#39;re not used to it.</p>
<p>So, if you want to just use standard script tags make sure your <code>package.json</code> has its
<code>happyFunTimes.apiVersion</code> set to <code>1.3.0</code> or higher and add the flag <code>happyFunTimes.useScriptTag</code> set
Expand All @@ -178,8 +169,7 @@ <h3 id="required-fields">Required fields</h3>
either <code>game.html</code> or <code>controller.html</code>. The HappyFunTimes libraries will be inserted before
those tags. The <code>game.js</code> or <code>controller.js</code> will be inserted after.</p>
<p>See example: <a href="http://github.com/hft-simple-script/">http://github.com/hft-simple-script/</a></p>
</li>
<li><p>&#39;happyFunTimes.ignore`</p>
<h4 id="-happyfuntimes-ignore-"><code>happyFunTimes.ignore</code></h4>
<p>Used to prevent certainly files from being part of the published game.</p>
<p>This is an array of strings in the format of <code>.gitignore</code> (<a href="http://git-scm.com/docs/gitignore">see git docs</a>)
not including the double asterix syntax. So for example</p>
Expand All @@ -195,8 +185,33 @@ <h3 id="required-fields">Required fields</h3>
}
}
</code></pre><p>would exclude the <code>&lt;projectdir&gt;/src</code> folder as well as any photoshop files.</p>
</li>
</ul>
<h4 id="-happyfuntimes-templatefileoptions-"><code>happyFunTimes.templateFileOptions</code></h4>
<p>requires apiVersion <code>1.15.0</code> or higher.</p>
<p>by default <code>game.html</code> automatically gets inserted into <code>templates/game.gameview.html</code>.
&#39;controller.html<code>automatically gets inserted into</code>templates/controller.index.html`.</p>
<p>If your project needs other files to be treated similarly you can use this option. A good example
is <a href="http://github.com/greggman/hft-tonde-iko">Tonde-Iko</a>. Its <code>game.html</code> is just a menu for
debugging, testing, and lanching individual screens. The game itself is run from <code>realgame.html</code>.
There&#39;s also a network stress test in <code>stress.html</code> and a file that creates the controller avatar
texture atlas in <code>makeimage.html</code>.</p>
<p>Each of those needed the templating treatment to get the happyfuntimes support libraries etc so
this was added to the package.json</p>
<pre><code>{
&quot;name&quot;: &quot;Tonde-Iko&quot;,
...
&quot;happyFunTimes&quot;: {
&quot;gameId&quot;: &quot;tonde-iko&quot;,
...
&quot;templateFileOptions&quot;: [
{ &quot;filename&quot;: &quot;realgame.html&quot;, &quot;template&quot;: &quot;game&quot; },
{ &quot;filename&quot;: &quot;stress.html&quot;, &quot;template&quot;: &quot;game&quot; },
{ &quot;filename&quot;: &quot;makeimage.html&quot;, &quot;template&quot;: &quot;game&quot; }
]
}
}
</code></pre><p>That basically says for those 3 files use the <code>game</code> template. They will automatically use
their respective scripts and css so for example <code>realgame.html</code> uses <code>scripts/realgame.js</code>
and <code>css/realgame.css</code></p>

<hr/>
<div>
Expand Down
Loading

0 comments on commit 7602b18

Please sign in to comment.