Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jul 15, 2015
1 parent 002c94d commit faac8cd
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 22 deletions.
2 changes: 2 additions & 0 deletions docs/api-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,5 @@ the correct version
portrait but as of iOS 8.3 Safari doesn't support orientation. So
the message that used to come up would be confusing as the user
orients their phone.


31 changes: 31 additions & 0 deletions docs/changelist.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,37 @@ <h1></h1>
<div class="col-sm-8 lesson-main">
<h1 id="changelist">Changelist</h1>
<ul>
<li><p>0.0.36</p>
<ul>
<li><p>added <code>--instructions</code> which puts a scrolling banner on top of each
game that says something like &quot;connect to HappyFunTimes wifi, on iOS
just wait, on Android use Chrome and go to &quot;h.com&quot;&quot;</p>
</li>
<li><p>added <code>--langs</code> to specify which languages games should use.</p>
<p>For controllers, if you support multiple languages you should probaby
use <code>navigator.language</code> but for the games since they are running on
my computer I needed a way to choose.</p>
</li>
<li><p>added <code>--wifi-name</code>, <code>--wifi-pass</code></p>
<p>This is to specify the name and password in the connect messages. See <code>--instructions</code></p>
</li>
<li><p>Hacked in more name support</p>
<p>gameclient now gets name and sends it automatically when controller starts.
On the one hand it feels &quot;impure&quot; to do it this way. On the other pragmatism wins.</p>
</li>
</ul>
</li>
<li><p>0.0.35</p>
<ul>
<li><p>Fixed a bug where if the page did not have the focus the controller
would not get redirected to the game.</p>
<p>I think that was in there for the app. The idea being if the app
is in the background it shouldn&#39;t join the game. Unfortunately it
also made it so typing in a URL often didn&#39;t work because when the
URL bar has the focus the page itself does not.</p>
</li>
</ul>
</li>
<li><p>0.0.34</p>
<ul>
<li><p>Made Unity version pay attention to <code>needNewHFT</code> flag.</p>
Expand Down
31 changes: 31 additions & 0 deletions docs/changelist.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
Changelist
==========

* 0.0.36

* added `--instructions` which puts a scrolling banner on top of each
game that says something like "connect to HappyFunTimes wifi, on iOS
just wait, on Android use Chrome and go to "h.com""

* added `--langs` to specify which languages games should use.

For controllers, if you support multiple languages you should probaby
use `navigator.language` but for the games since they are running on
my computer I needed a way to choose.

* added `--wifi-name`, `--wifi-pass`

This is to specify the name and password in the connect messages. See `--instructions`

* Hacked in more name support

gameclient now gets name and sends it automatically when controller starts.
On the one hand it feels "impure" to do it this way. On the other pragmatism wins.

* 0.0.35

* Fixed a bug where if the page did not have the focus the controller
would not get redirected to the game.

I think that was in there for the app. The idea being if the app
is in the background it shouldn't join the game. Unfortunately it
also made it so typing in a URL often didn't work because when the
URL bar has the focus the page itself does not.

* 0.0.34

* Made Unity version pay attention to `needNewHFT` flag.
Expand Down
8 changes: 8 additions & 0 deletions docs/commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ <h3 id="-hft-start-"><code>hft start</code></h3>
a game to start. If multiple games are running users are given a list to choose from.
If you&#39;re running in an <a href="network.html">installation</a> where there&#39;s only 1 game you can have controller
go directly to the game with this option.</p>
<p><code>--instructions</code></p>
<p>Displays a scrolling message on the screen telling users how to connect to the game</p>
<p><code>--langs</code></p>
<p>Chooses which languages to display instructions. Example <code>--langs=en,ja</code></p>
<p><code>--wifi-name</code></p>
<p>Specifies the WiFi name for the connect message.</p>
<p><code>--wifi-pass</code></p>
<p>Specifies the WiFi password for the connect message.</p>
<p><code>--check-for-app</code></p>
<p>Controllers don&#39;t normally try to launch the native mobile app. This check takes 3 seconds.
Use this switch to add that check so if the user has the app installed it will switch to
Expand Down
16 changes: 16 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ a game to start. If multiple games are running users are given a list to choose
If you're running in an [installation](network.md) where there's only 1 game you can have controller
go directly to the game with this option.

`--instructions`

Displays a scrolling message on the screen telling users how to connect to the game

`--langs`

Chooses which languages to display instructions. Example `--langs=en,ja`

`--wifi-name`

Specifies the WiFi name for the connect message.

`--wifi-pass`

Specifies the WiFi password for the connect message.

`--check-for-app`

Controllers don't normally try to launch the native mobile app. This check takes 3 seconds.
Expand Down
4 changes: 2 additions & 2 deletions docs/network.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ <h2 id="looking-up-your-mac-address">Looking Up Your MAC Address</h2>
<p>NOTE!!!: Your computer has a different MAC address for WiFi vs Wired networking. <strong>The MAC address
you need to look up is the MAC address for the way you&#39;ll connect the happyfuntimes machine
to the router!</strong></p>
<p>If can connect the happyfuntimes computer to the router with an ethernet cable that should
be your first choice because you don&#39;t have to worry about interference.</p>
<p>If you can connect the happyfuntimes computer to the router with an ethernet cable that should
be your first choice because you don&#39;t have to worry about WiFi interference.</p>
<p>If you&#39;re connecting the happyfuntimes comptuer to the router via WiFi then you need to look up your
computer&#39;s WiFi MAC address.</p>
<p><strong>Be sure to look up the correct MAC address</strong></p>
Expand Down
4 changes: 2 additions & 2 deletions docs/network.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ NOTE!!!: Your computer has a different MAC address for WiFi vs Wired networking.
you need to look up is the MAC address for the way you'll connect the happyfuntimes machine
to the router!**

If can connect the happyfuntimes computer to the router with an ethernet cable that should
be your first choice because you don't have to worry about interference.
If you can connect the happyfuntimes computer to the router with an ethernet cable that should
be your first choice because you don't have to worry about WiFi interference.

If you're connecting the happyfuntimes comptuer to the router via WiFi then you need to look up your
computer's WiFi MAC address.
Expand Down
22 changes: 13 additions & 9 deletions docs/unity/gamepad.html
Original file line number Diff line number Diff line change
Expand Up @@ -196,34 +196,38 @@ <h5 id="setcolor">SetColor</h5>
that is different from other players. To do that we reverse the least significant
6 bits which means instead of counting 0, 1, 2, 3, 4, 5, 6, 7, 8 we end up counting
0, 32, 16, 48, 8, 40, 24, 56, ... 6 bits means we have a range of 0 to 63 so dividing
by 64 gives as an amount to adjust the hue.</p>
by 64 gives us an amount from 0.0 to 1.0 to adjust the hue around the color wheel.</p>
<pre><code>float hueAdjust = (((colorNdx &amp; 0x01) &lt;&lt; 5) |
((colorNdx &amp; 0x02) &lt;&lt; 3) |
((colorNdx &amp; 0x04) &lt;&lt; 1) |
((colorNdx &amp; 0x08) &gt;&gt; 1) |
((colorNdx &amp; 0x10) &gt;&gt; 3) |
((colorNdx &amp; 0x20) &gt;&gt; 5)) / 64.0f;
</code></pre><p>These 2 lines make every other set of 8 players be 50% darker
and every other set of 4 players be 50% less saturated.</p>
<pre><code>float valueAdjust = (colorNdx &amp; 0x08) != 0 ? -0.5f : 0.0f;
float satAdjust = (colorNdx &amp; 0x04) != 0 ? -0.5f : 0.0f;
</code></pre><p>These 2 lines make every other set of 32 players be 50% darker
and every other set of 16 players be 50% less saturated.</p>
<pre><code>float satAdjust = (colorNdx &amp; 0x10) != 0 ? -0.5f : 0.0f;
float valueAdjust = (colorNdx &amp; 0x20) != 0 ? -0.5f : 0.0f;
</code></pre><p>Hopefully that comes up with good colors.</p>
<p>The rest seems pretty straight forward</p>
<p>The rest seems pretty straight forward. The one HappyFunTimes line
is <code>m_gamepad.Color = playerColor</code>. Setting <code>m_gamepad.Color</code> will
tell the controller to change to a matching color.</p>
<pre><code>// get the hsva for the baseColor
Vector4 hsva = ColorUtils.ColorToHSVA(baseColor);
Vector4 hsva = HFTColorUtils.ColorToHSVA(baseColor);

// adjust that base color by the amount we picked
hsva.x += hueAdjust;
hsva.y += satAdjust;
hsva.z += valueAdjust;

// now get the adjusted color.
Color playerColor = ColorUtils.HSVAToColor(hsva);
Color playerColor = HFTColorUtils.HSVAToColor(hsva);

// Tell the gamepad to change color
m_gamepad.Color = playerColor];

// Create a 1 pixel texture for the OnGUI code to draw the label
Color[] pix = new Color[1];
pix[0] = playerColor;
m_gamepad.Color = pix[0]; // Tell the gamepad to change color
Texture2D tex = new Texture2D(1, 1);
tex.SetPixels(pix);
tex.Apply();
Expand Down
22 changes: 13 additions & 9 deletions docs/unity/gamepad.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Based on the player number which we use as `colorNdx` we pick a player color. Th
that is different from other players. To do that we reverse the least significant
6 bits which means instead of counting 0, 1, 2, 3, 4, 5, 6, 7, 8 we end up counting
0, 32, 16, 48, 8, 40, 24, 56, ... 6 bits means we have a range of 0 to 63 so dividing
by 64 gives as an amount to adjust the hue.
by 64 gives us an amount from 0.0 to 1.0 to adjust the hue around the color wheel.

float hueAdjust = (((colorNdx & 0x01) << 5) |
((colorNdx & 0x02) << 3) |
Expand All @@ -174,31 +174,35 @@ by 64 gives as an amount to adjust the hue.
((colorNdx & 0x10) >> 3) |
((colorNdx & 0x20) >> 5)) / 64.0f;

These 2 lines make every other set of 8 players be 50% darker
and every other set of 4 players be 50% less saturated.
These 2 lines make every other set of 32 players be 50% darker
and every other set of 16 players be 50% less saturated.

float valueAdjust = (colorNdx & 0x08) != 0 ? -0.5f : 0.0f;
float satAdjust = (colorNdx & 0x04) != 0 ? -0.5f : 0.0f;
float satAdjust = (colorNdx & 0x10) != 0 ? -0.5f : 0.0f;
float valueAdjust = (colorNdx & 0x20) != 0 ? -0.5f : 0.0f;

Hopefully that comes up with good colors.

The rest seems pretty straight forward
The rest seems pretty straight forward. The one HappyFunTimes line
is `m_gamepad.Color = playerColor`. Setting `m_gamepad.Color` will
tell the controller to change to a matching color.

// get the hsva for the baseColor
Vector4 hsva = ColorUtils.ColorToHSVA(baseColor);
Vector4 hsva = HFTColorUtils.ColorToHSVA(baseColor);

// adjust that base color by the amount we picked
hsva.x += hueAdjust;
hsva.y += satAdjust;
hsva.z += valueAdjust;

// now get the adjusted color.
Color playerColor = ColorUtils.HSVAToColor(hsva);
Color playerColor = HFTColorUtils.HSVAToColor(hsva);

// Tell the gamepad to change color
m_gamepad.Color = playerColor];

// Create a 1 pixel texture for the OnGUI code to draw the label
Color[] pix = new Color[1];
pix[0] = playerColor;
m_gamepad.Color = pix[0]; // Tell the gamepad to change color
Texture2D tex = new Texture2D(1, 1);
tex.SetPixels(pix);
tex.Apply();
Expand Down

0 comments on commit faac8cd

Please sign in to comment.