Pre-release

@maxbilbow maxbilbow released this May 27, 2015 · 11 commits to v0.11.x since this release

Assets 4

Controls for v0.11.7 on OS X

/// Contains Keys control mapping for a desktop interface.
///
/// For example, the following gives a forward momentum of '2' when 'w' is pressed, and 0 when 'w' is released:
///
///   let MOVE_SPEED: (on:RMFloat,off:RMFloat) = (2, 0)
///   var key = RMKey(self, action: "forward", characters: "w", speed: MOVE_SPEED)
///
/// The RMSActionProcessor class handles the application of the human term "forward", regardless of interface used. See also `RMXDPad` for iOS.
///
/// See also: `RMKeys` and  `RMSActionProcessor`.
class RMSKeys : RMXInterface {

    ///Key down, Key up options
    static let ON_KEY_DOWN: (on:RMFloat,off:RMFloat) = (1,0)
    static let ON_KEY_UP: (on:RMFloat,off:RMFloat) = (0,1)
    static let MOVE_SPEED: (on:RMFloat,off:RMFloat) = (RMXInterface.moveSpeed * 2, 0)
    static let LOOK_SPEED: (on:RMFloat,off:RMFloat) = (RMXInterface.lookSpeed * -10, 0)

    ///Key settings
    lazy var keys: [ RMKey ] = [

// Basic Movement
    RMKey(self, action: MOVE_FORWARD, characters: "w", speed: MOVE_SPEED),
    RMKey(self, action: MOVE_BACKWARD, characters: "s", speed: MOVE_SPEED),
    RMKey(self, action: MOVE_LEFT, characters: "a", speed: MOVE_SPEED),
    RMKey(self, action: MOVE_RIGHT, characters: "d", speed: MOVE_SPEED),
    RMKey(self, action: MOVE_UP, characters: "e", speed: MOVE_SPEED),
    RMKey(self, action: MOVE_DOWN, characters: "q", speed: MOVE_SPEED),
    RMKey(self, action: ROLL_LEFT, characters: "z", speed: LOOK_SPEED),
    RMKey(self, action: ROLL_RIGHT, characters: "x", speed: LOOK_SPEED),
    RMKey(self, action: JUMP, characters: " ", speed: ON_KEY_UP),
    RMKey(self, action: ROTATE, characters: MOVE_CURSOR_PASSIVE, isRepeating: false,speed: LOOK_SPEED),

    //Interactions
    RMKey(self, action: GRAB_ITEM, characters: LEFT_CLICK, isRepeating: false, speed: ON_KEY_UP),
    RMKey(self, action: THROW_ITEM, characters: RIGHT_CLICK, isRepeating: false,  speed: (0,20)),
    RMKey(self, action: BOOM, characters: "b", isRepeating: false,  speed: ON_KEY_UP),

    //Environmentals
    RMKey(self, action: TOGGLE_GRAVITY, characters: "g", isRepeating: false,speed: ON_KEY_UP),
    //RMKey(self, action: "toggleGravity", characters: "G", isRepeating: false,speed: ON_KEY_UP),
    RMKey(self, action: TOGGLE_AI, characters: "A", isRepeating: false,speed: ON_KEY_UP),
    RMKey(self, action: RESET, characters: "R", isRepeating: false,speed: ON_KEY_UP),

    //Interface options
    RMKey(self, action: LOCK_CURSOR, characters: "m", isRepeating: false, speed: ON_KEY_UP),
    RMKey(self, action: NEXT_CAMERA, characters: ".", isRepeating: false, speed: ON_KEY_DOWN),
    RMKey(self, action: PREV_CAMERA, characters: ",", isRepeating: false, speed: ON_KEY_DOWN),
    RMKey(self, action: PAUSE_GAME, characters: "p", isRepeating: false, speed: ON_KEY_UP),
    RMKey(self, action: KEYBOARD_LAYOUT, characters: "k", isRepeating: false, speed: ON_KEY_UP),

    //Misc: generically used for testing
    RMKey(self, action: GET_INFO, characters: "i", isRepeating: false,speed: ON_KEY_DOWN), //Prints to terminal when testing
    RMKey(self, action: ZOOM_IN, characters: "=", isRepeating: true, speed: MOVE_SPEED),
    RMKey(self, action: ZOOM_OUT, characters: "-", isRepeating: true, speed: MOVE_SPEED)
]
}

Changes for French Keyboard

case .French:
            inteface.set(action: RMX.MOVE_FORWARD, characters: "z")
            inteface.set(action: RMX.MOVE_LEFT, characters: "q")
            inteface.set(action: RMX.MOVE_DOWN, characters: "a")
            inteface.set(action: RMX.ROLL_LEFT, characters: "w")

            inteface.set(action: RMX.NEXT_CAMERA, characters: "=")
            inteface.set(action: RMX.PREV_CAMERA, characters: ":")

            inteface.set(action: RMX.ZOOM_IN, characters: "-")
            inteface.set(action: RMX.ZOOM_OUT, characters: ")")
            break

Images below are from iOS