Skip to content

Commit 7602b18

Browse files
committed
update docs
1 parent 592b4dd commit 7602b18

File tree

4 files changed

+172
-114
lines changed

4 files changed

+172
-114
lines changed

docs/api-versions.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ <h3 id="talking-between-games">Talking between games</h3>
392392
<code>&quot;instuctionsPosition&quot;: &quot;bottom&quot;</code> to the <code>happyFunTimes</code> section of your
393393
<code>package.json</code> file to set it per game. The default is top.</p>
394394
</li>
395+
<li><p>Added <code>happyFunTimes.templateFileOptions</code></p>
396+
<p><a href="packagejson.html#-happyfuntimes-templatefileoptions-">See docs</a></p>
397+
</li>
395398
</ul>
396399
</li>
397400
</ul>

docs/api-versions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,10 @@ the correct version
366366
or `top` to set the position of the instructions. You can also add
367367
`"instuctionsPosition": "bottom"` to the `happyFunTimes` section of your
368368
`package.json` file to set it per game. The default is top.
369+
370+
* Added `happyFunTimes.templateFileOptions`
371+
372+
[See docs](packagejson.md#-happyfuntimes-templatefileoptions-)
373+
374+
375+

docs/packagejson.html

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ <h1 id="-package-json">Package.json</h1>
7373
<ul>
7474
<li><p>No trailing commmas.</p>
7575
<p>Good</p>
76-
<p> {</p>
77-
<pre><code> &quot;a&quot;: 123,
78-
&quot;b&quot;: 456
79-
</code></pre><p> }</p>
80-
<p>Bad</p>
81-
<p> {</p>
82-
<pre><code> &quot;a&quot;: 123,
83-
&quot;b&quot;: 456,
84-
</code></pre><p> }</p>
85-
</li>
76+
<pre><code>{
77+
&quot;a&quot;: 123,
78+
&quot;b&quot;: 456
79+
}
80+
</code></pre><p>Bad</p>
81+
<pre><code>{
82+
&quot;a&quot;: 123,
83+
&quot;b&quot;: 456,
84+
}
85+
</code></pre></li>
8686
<li><p>No comments! JSON is NOT JavaScript.</p>
8787
</li>
8888
<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>,
@@ -108,26 +108,20 @@ <h3 id="required-fields">Required fields</h3>
108108
&quot;minPlayers&quot;: 1
109109
}
110110
}
111-
</code></pre><ul>
112-
<li><p><code>name</code></p>
111+
</code></pre><h4 id="-name-"><code>name</code></h4>
113112
<p>A name for your game. Used on the main screen of HappyFunTimes and SuperHappyFunTimes</p>
114-
</li>
115-
<li><p><code>description</code></p>
113+
<h4 id="-description-"><code>description</code></h4>
116114
<p>A description. Used on superhappyfuntimes. No HTML allowed currently.</p>
117-
</li>
118-
<li><p><code>version</code></p>
115+
<h4 id="-version-"><code>version</code></h4>
119116
<p>Used on superhappyfuntimes so users can know if there is a newer version for them to download.</p>
120-
</li>
121-
<li><p><code>happyFunTimes.gameId</code></p>
117+
<h4 id="-happyfuntimes-gameid-"><code>happyFunTimes.gameId</code></h4>
122118
<p>This is the id for your game. Every game on superhappyfuntimes must have a unique id.
123119
only A-Z, 0-9, _, - are allowed and no more than 60 charactera.</p>
124-
</li>
125-
<li><p><code>happyFunTimes.apiVersion</code></p>
120+
<h4 id="-happyfuntimes-apiversion-"><code>happyFunTimes.apiVersion</code></h4>
126121
<p>This is the happyFunTimes API version needed by this game. If this number is higher
127122
than the version of happyFunTimes the user has installed they will be asked to upgrade.
128123
It is also used by happyFunTimes to provide the correct API for the game.</p>
129-
</li>
130-
<li><p><code>happyFunTimes.gameType</code></p>
124+
<h4 id="-happyfuntimes-gametype-"><code>happyFunTimes.gameType</code></h4>
131125
<p>This is used by happyFunTimes to figure out how to deal with the game. For example
132126
how to launch the game and how to publish it.</p>
133127
<p>Valid values are</p>
@@ -136,28 +130,25 @@ <h3 id="required-fields">Required fields</h3>
136130
<li><code>Unity3D</code></li>
137131
<li><code>Unity3DLibrary</code></li>
138132
</ul>
139-
</li>
140-
<li><p><code>happyFunTimes.minPlayers</code></p>
133+
<h4 id="-happyfuntimes-minplayers-"><code>happyFunTimes.minPlayers</code></h4>
141134
<p>How many players are required to play this game. For example, jumpjump you can play with
142135
one player. It&#39;s probably not any fun but you can player. boomboom on the otherhand
143136
requires 2 players. It will not start until there are 2 players.</p>
144137
<p>This is only used on the superhappyfuntimes to set expectations. If you have a game that requires
145138
10 players please consider marking it here.</p>
146-
</li>
147-
<li><p><code>happyFunTimes.category</code></p>
139+
<h4 id="-happyfuntimes-category-"><code>happyFunTimes.category</code></h4>
148140
<p>This is also only used on superhappyfuntimes to set expections and hopefully to, um, categories
149141
things. Current values</p>
150142
<ul>
151143
<li><code>game</code> A game</li>
152144
<li><code>example</code> Not a game, not really meant to be played, just an example</li>
153145
<li><code>demo</code> Not a game, something else like an exhibit, possibly not playable without more stuff</li>
154146
</ul>
155-
</li>
156-
<li><p><code>happyFunTimes.useScriptTag</code></p>
147+
<h4 id="-happyfuntimes-usescripttag-"><code>happyFunTimes.useScriptTag</code></h4>
157148
<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>
158149
must be <code>1.3.0</code> or higher</p>
159150
<p>I really like <a href="http://requirejs.org">require.js</a> style of modules. It encourages
160-
dependency injection, it also suppots module independence. But, for many it&#39;s non
151+
dependency injection, it also supports module independence. But, for many it&#39;s non
161152
standard and they&#39;re not used to it.</p>
162153
<p>So, if you want to just use standard script tags make sure your <code>package.json</code> has its
163154
<code>happyFunTimes.apiVersion</code> set to <code>1.3.0</code> or higher and add the flag <code>happyFunTimes.useScriptTag</code> set
@@ -178,8 +169,7 @@ <h3 id="required-fields">Required fields</h3>
178169
either <code>game.html</code> or <code>controller.html</code>. The HappyFunTimes libraries will be inserted before
179170
those tags. The <code>game.js</code> or <code>controller.js</code> will be inserted after.</p>
180171
<p>See example: <a href="http://github.com/hft-simple-script/">http://github.com/hft-simple-script/</a></p>
181-
</li>
182-
<li><p>&#39;happyFunTimes.ignore`</p>
172+
<h4 id="-happyfuntimes-ignore-"><code>happyFunTimes.ignore</code></h4>
183173
<p>Used to prevent certainly files from being part of the published game.</p>
184174
<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>)
185175
not including the double asterix syntax. So for example</p>
@@ -195,8 +185,33 @@ <h3 id="required-fields">Required fields</h3>
195185
}
196186
}
197187
</code></pre><p>would exclude the <code>&lt;projectdir&gt;/src</code> folder as well as any photoshop files.</p>
198-
</li>
199-
</ul>
188+
<h4 id="-happyfuntimes-templatefileoptions-"><code>happyFunTimes.templateFileOptions</code></h4>
189+
<p>requires apiVersion <code>1.15.0</code> or higher.</p>
190+
<p>by default <code>game.html</code> automatically gets inserted into <code>templates/game.gameview.html</code>.
191+
&#39;controller.html<code>automatically gets inserted into</code>templates/controller.index.html`.</p>
192+
<p>If your project needs other files to be treated similarly you can use this option. A good example
193+
is <a href="http://github.com/greggman/hft-tonde-iko">Tonde-Iko</a>. Its <code>game.html</code> is just a menu for
194+
debugging, testing, and lanching individual screens. The game itself is run from <code>realgame.html</code>.
195+
There&#39;s also a network stress test in <code>stress.html</code> and a file that creates the controller avatar
196+
texture atlas in <code>makeimage.html</code>.</p>
197+
<p>Each of those needed the templating treatment to get the happyfuntimes support libraries etc so
198+
this was added to the package.json</p>
199+
<pre><code>{
200+
&quot;name&quot;: &quot;Tonde-Iko&quot;,
201+
...
202+
&quot;happyFunTimes&quot;: {
203+
&quot;gameId&quot;: &quot;tonde-iko&quot;,
204+
...
205+
&quot;templateFileOptions&quot;: [
206+
{ &quot;filename&quot;: &quot;realgame.html&quot;, &quot;template&quot;: &quot;game&quot; },
207+
{ &quot;filename&quot;: &quot;stress.html&quot;, &quot;template&quot;: &quot;game&quot; },
208+
{ &quot;filename&quot;: &quot;makeimage.html&quot;, &quot;template&quot;: &quot;game&quot; }
209+
]
210+
}
211+
}
212+
</code></pre><p>That basically says for those 3 files use the <code>game</code> template. They will automatically use
213+
their respective scripts and css so for example <code>realgame.html</code> uses <code>scripts/realgame.js</code>
214+
and <code>css/realgame.css</code></p>
200215

201216
<hr/>
202217
<div>

0 commit comments

Comments
 (0)