From cfeac68b36504a66e02ffdeb2b67ed789fbd91fa Mon Sep 17 00:00:00 2001 From: onpon4 Date: Sun, 1 Mar 2015 19:59:27 -0500 Subject: [PATCH] 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). --- docs/index.html | 70 ++++++++++++++++++++----------------------------- src/player.cpp | 18 ++++++++++--- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/index.html b/docs/index.html index a7ba45e..deeb550 100644 --- a/docs/index.html +++ b/docs/index.html @@ -59,57 +59,45 @@ along with this program. If not, see . opens with Chris attempting to escape a Weapco patrol that has intercepted him.

-

Installation

- -

Installation under Linux:

-
-tar zxf starfighter-1.2.tar.gz
-cd starfighter-1.2
-make
-make install
-
- -

When the game is first run it will attempt to create ~/.parallelrealities/starfighter/. - Should this fail the game will not run.

-

Controls

Menus

Intermission Screen

In Game

Joystick and Gamepad support

Note - Keys cannot be changed

@@ -125,11 +113,11 @@ make install the options shown:

* Will only be shown if there are saved games @@ -230,11 +218,11 @@ make install you pick up, as well as mission related information.

    -
  • White messages are standard for picking up items such as cash and power ups. -
  • Green messages signify successful completion of mission objectives. -
  • Light Blue messages give further details about Primary mission requirements. -
  • Red messages indicate mission failures, warnings and wing mate ejections. -
  • Yellow messages give further details about Secondary mission requirements. +
  • White messages are standard for picking up items such as cash and power ups.
  • +
  • Green messages signify successful completion of mission objectives.
  • +
  • Light Blue messages give further details about Primary mission requirements.
  • +
  • Red messages indicate mission failures, warnings and wing mate ejections.
  • +
  • Yellow messages give further details about Secondary mission requirements.

The Target Arrow

diff --git a/src/player.cpp b/src/player.cpp index 5818aa3..3f02854 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -429,14 +429,26 @@ void getPlayerInput() switch (engine.event.jbutton.button) { case 0: - engine.keyState[KEY_FIRE] = engine.event.jbutton.state; - break; - case 1: + case 3: engine.keyState[KEY_ALTFIRE] = engine.event.jbutton.state; break; + case 1: 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; break; + case 9: + if (engine.event.jbutton.state) + engine.keyState[KEY_PAUSE] = 1; + break; } break;