Updated joystick controls to work well with most gamepads.

All gamepads I've come across work OK with button 2 or 3 as the primary
button, and button 1 or 4 as the secondary button. For the rest,
basically invariably, buttons 5 and 7 are the left shoulder buttons,
buttons 6 and 8 are the right shoulder buttons, button 9 is "Select"
or "Back", and button 10 is "Start". Based on this, I've changed
the gamepad controls to something that should work for most gamepads.

Also fixed some bad HTML in the documentation, and removed the
build instructions from there (they will soon be obsolete; I'm
working on replacing the hand-made Makefile with GNU Autoconf).
This commit is contained in:
onpon4 2015-03-01 19:59:27 -05:00
parent 9959c47f98
commit cfeac68b36
2 changed files with 44 additions and 44 deletions

View File

@ -59,57 +59,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
opens with Chris attempting to escape a Weapco patrol that has opens with Chris attempting to escape a Weapco patrol that has
intercepted him.</p> intercepted him.</p>
<h2>Installation</h2>
<p>Installation under Linux:</p>
<pre>
tar zxf starfighter-1.2.tar.gz
cd starfighter-1.2
make
make install
</pre>
<p>When the game is first run it will attempt to create <code>~/.parallelrealities/starfighter/</code>.
Should this fail the game will not run.</p>
<h2>Controls</h2> <h2>Controls</h2>
<p>Menus</p> <p>Menus</p>
<ul> <ul>
<li> Arrow Keys - Highlight option <li>Arrow Keys - Highlight option</li>
<li> Control / Space - Select menu option <li>Control / Enter - Select menu option</li>
</ul> </ul>
<p>Intermission Screen</p> <p>Intermission Screen</p>
<ul> <ul>
<li>Mouse or Arrow Keys - Move cursor <li>Mouse or Arrow Keys - Move cursor</li>
<li>Left Mouse Button - Selected option <li>Left Mouse Button or Control / Enter - Selected option</li>
<li>Right Mouse Button - Toggle planet orbit On / Off <li>Right Mouse Button or Space - Toggle planet orbit On / Off</li>
</ul> </ul>
<p>In Game</p> <p>In Game</p>
<ul> <ul>
<li>Arrow Keys - Control Firefly <li>Arrow Keys - Control Firefly</li>
<li>Ctrl - Fire primary weapon <li>Ctrl - Fire primary weapon</li>
<li>Space - Fire secondary weapon <li>Space - Fire secondary weapon</li>
<li>Shift - Toggle Primary Weapon Concentrate / Spread (see Weaponry) <li>Shift - Toggle Primary Weapon Concentrate / Spread (see Weaponry)</li>
<li>T - Switch Targetting Arrow mode <li>P - Pause / Unpause</li>
<li>P - Pause / Unpause <li>Escape - Flee (not possible until all primary missions completed)</li>
<li>Escape - Flee (not possible until all primary missions completed) <li>Escape whilst paused - Quit to title screen</li>
<li>Escape whilst paused - Quit to title screen
</ul> </ul>
<p>Joystick and Gamepad support</p> <p>Joystick and Gamepad support</p>
<ul> <ul>
<li>Stick or Hat - Same as Arrow Keys <li>Stick or Hat - Same as Arrow Keys</li>
<li>Button 0 - Fire primary weapon / Select menu option <li>Button 1 / 4 - Fire primary weapon / Select menu option</li>
<li>Button 1 - Fire secondary weapon / Select menu option <li>Button 2 / 3 - Fire secondary weapon / Select menu option</li>
<li>Button 2 - Toggle Primary Weapon Concentrate / Spread <li>Button 6 / 8 / 9 - Toggle Primary Weapon Concentrate / Spread</li>
<li>Button 3 - Switch Targetting Arrow mode <li>Button 10 - Pause / Unpause</li>
<li>Button 5 / 7 - Flee (not possible until all primary missions completed)</li>
<li>Button 5 / 7 whilst paused - Quit to title screen</li>
</ul> </ul>
<p>Note - Keys cannot be changed</p> <p>Note - Keys cannot be changed</p>
@ -125,11 +113,11 @@ make install
the options shown:</p> the options shown:</p>
<ul class="menu"> <ul class="menu">
<li> Start New Game <li>Start New Game</li>
<li> Load Game* <li>Load Game*</li>
<li> Continue Current Game* <li>Continue Current Game*</li>
<li> Options <li>Options</li>
<li> Quit <li>Quit</li>
</ul> </ul>
<p><i>* Will only be shown if there are saved games <p><i>* Will only be shown if there are saved games
@ -230,11 +218,11 @@ make install
you pick up, as well as mission related information.</p> you pick up, as well as mission related information.</p>
<ul> <ul>
<li><font color="#FFFFFF">White messages</font> are standard for picking up items such as cash and power ups. <li><font color="#FFFFFF">White messages</font> are standard for picking up items such as cash and power ups.</li>
<li><font color="#00FF00">Green messages</font> signify successful completion of mission objectives. <li><font color="#00FF00">Green messages</font> signify successful completion of mission objectives.</li>
<li><font color="#00FFFF">Light Blue messages</font> give further details about Primary mission requirements. <li><font color="#00FFFF">Light Blue messages</font> give further details about Primary mission requirements.</li>
<li><font color="#FF0000">Red messages</font> indicate mission failures, warnings and wing mate ejections. <li><font color="#FF0000">Red messages</font> indicate mission failures, warnings and wing mate ejections.</li>
<li><font color="#FFFF00">Yellow messages</font> give further details about Secondary mission requirements. <li><font color="#FFFF00">Yellow messages</font> give further details about Secondary mission requirements.</li>
</ul> </ul>
<h2>The Target Arrow</h2> <h2>The Target Arrow</h2>

View File

@ -429,14 +429,26 @@ void getPlayerInput()
switch (engine.event.jbutton.button) switch (engine.event.jbutton.button)
{ {
case 0: case 0:
engine.keyState[KEY_FIRE] = engine.event.jbutton.state; case 3:
break;
case 1:
engine.keyState[KEY_ALTFIRE] = engine.event.jbutton.state; engine.keyState[KEY_ALTFIRE] = engine.event.jbutton.state;
break; break;
case 1:
case 2: case 2:
engine.keyState[KEY_FIRE] = engine.event.jbutton.state;
break;
case 4:
case 6:
engine.keyState[KEY_ESCAPE] = engine.event.jbutton.state;
break;
case 5:
case 7:
case 8:
engine.keyState[KEY_SWITCH] = engine.event.jbutton.state; engine.keyState[KEY_SWITCH] = engine.event.jbutton.state;
break; break;
case 9:
if (engine.event.jbutton.state)
engine.keyState[KEY_PAUSE] = 1;
break;
} }
break; break;