[airstrike] Joystick support (small fix)
auerswal at unix-ag.uni-kl.de
Thu May 5 16:01:37 EDT 2005
> Thanks again. As you might have noticed I added reading of the
> joystick definition from a configuration file:
> ai->joy_accelerate = conf_number(key_conf,"joy_accelerate",JOY_AXIS1_NEG);
> This means, give me the value of joy_accelerate in the config file if
> it exists, else set it to JOY_AXIS1_NEG and return that value. I will
> also add some method to change the values inside the game, and save
This works for me. :-) Since joysticks #5 and #6 on my system are best
suited for airstrike this is really handy.
I've updated doc/joystick.txt mentioning the config file, a patch (against
the CVS version with my last joystick patch (airstrike-new-joystick.patch)
applied) is attached to this mail.
-------------- next part --------------
diff -bNru airstrike.orig/doc/joystick.txt airstrike.new/doc/joystick.txt
--- airstrike.orig/doc/joystick.txt 2005-05-05 21:49:54.000000000 +0200
+++ airstrike.new/doc/joystick.txt 2005-05-05 21:41:58.000000000 +0200
@@ -2,8 +2,10 @@
Instead of using the SDL event system the joysticks are polled whenever an
update message is sent to a sprite controlled by a human player. Different
to the keyboard input there is a seperate function to get the current
-joystick state that has to be called before checking the state. Joystick
-input is digital, i.e. any (axis) movement above a certain threshold is
-interpreted as the corresponding action (e.g. acceleration). The mapping
-of joystick input to game actions is hardcoded in engine/ai.c similar
-to the keyboard configuration. Each player can use up to one joystick.
+joystick state that has to be called before checking the state.
+Joystick input is digital, i.e. any (axis) movement above a certain
+threshold is interpreted as the corresponding action (e.g. acceleration).
+The mapping of joystick input to game actions is read from a config file
+(with hardcoded defaults in engine/ai.c if no config file is present)
+similar to the keyboard configuration. Each player can use up to one
+joystick (several players could share a joystick ;).
More information about the airstrike