#ifndef _H_Controller #define _H_Controller #include "KeyState.h" enum { KEYBOARD_CONTROLLER, JOYSTICK_CONTROLLER, AUTOMATIC_CONTROLLER }; // Use for the state machine that is used with AUTOMATIC_CONTROLLER. // enum { STATE_READY_FOR_TAKE_OFF, STATE_ON_RUNWAY, STATE_FIRST_CLIMB, STATE_IN_FLIGHT, STATE_LOOPING_CLIMB, STATE_LOOPING_DIVE, STATE_ATTACK_CLIMB, STATE_ATTACK_DIVE, }; typedef struct Controller { byte controlType; // *_CONTROLLER enum value struct BiplaneMover *mover; // For KEYBOARD_CONTROLLER case: KeyState fireKeyState; // For JOYSTICK_CONTROLLER case: byte joyButtonMask; // For AUTOMATIC_CONTROLLER case: byte state; // STATE_* value word numFramesBeforeStateChange; } Controller; // probeBit: KEY_PROBE_*. // testBit: KEY_BIT_*. // joyButtonMask: JOY_BUTTON_*_MASK. // void Controller_init(Controller *self, byte controlType, struct BiplaneMover *mover, byte probeBit, byte testBit, byte joyButtonMask); // Must be called at each point where the plane starts exploding. // void Controller_onBiplaneExplosion(Controller *self); #endif /* _H_Controller */