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

Assets 4

Controls for v0.10.6 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: "forward", characters: "w", speed: MOVE_SPEED),
    RMKey(self, action: "back", characters: "s", speed: MOVE_SPEED),
    RMKey(self, action: "left", characters: "a", speed: MOVE_SPEED),
    RMKey(self, action: "right", characters: "d", speed: MOVE_SPEED),
    RMKey(self, action: "up", characters: "e", speed: MOVE_SPEED),
    RMKey(self, action: "down", characters: "q", speed: MOVE_SPEED),
    RMKey(self, action: "rollLeft", characters: "z", speed: LOOK_SPEED),
    RMKey(self, action: "rollRight", characters: "x", speed: LOOK_SPEED),
    RMKey(self, action: "jump", characters: " "),
    RMKey(self, action: "look", characters: "mouseMoved", isRepeating: false,speed: LOOK_SPEED),

    //Interactions
    RMKey(self, action: "grab", characters: "Mouse 1", isRepeating: false, speed: ON_KEY_UP),
    RMKey(self, action: "throwItem", characters: "Mouse 2", isRepeating: false,  speed: (0,20)),
    RMKey(self, action: "explode", characters: "b", isRepeating: false,  speed: ON_KEY_UP),

    //Environmentals
    RMKey(self, action: "toggleAllGravity", characters: "g", isRepeating: false,speed: ON_KEY_UP),
    //RMKey(self, action: "toggleGravity", characters: "G", isRepeating: false,speed: ON_KEY_UP),
    RMKey(self, action: "toggleAI", 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: "lockMouse", characters: "m", isRepeating: false, speed: ON_KEY_UP),
    RMKey(self, action: "nextCamera", characters: ".", isRepeating: false, speed: ON_KEY_DOWN),
    RMKey(self, action: "previousCamera", characters: ",", isRepeating: false, speed: ON_KEY_DOWN),

    //Misc: generically used for testing
    RMKey(self, action: "information", characters: "i", isRepeating: false,speed: ON_KEY_DOWN), //Prints to terminal when testing
    RMKey(self, action: "zoomIn", characters: "=", isRepeating: true, speed: MOVE_SPEED),
    RMKey(self, action: "zoomOut", 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