From 66c1e93888b58d8fbb7d1dea25f2e1fcecde827b Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 2 Dec 2005 00:46:45 +0000 Subject: [PATCH] ship slide left/right --- direct/src/controls/ControlManager.py | 31 +++++++++++++++++++++++++++ direct/src/controls/ShipPilot.py | 12 +++++------ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/direct/src/controls/ControlManager.py b/direct/src/controls/ControlManager.py index c531400d5f..5b226b555f 100755 --- a/direct/src/controls/ControlManager.py +++ b/direct/src/controls/ControlManager.py @@ -114,6 +114,37 @@ class ControlManager: inputState.watch("turnRight", "control-alt-e", "e-up") inputState.watch("turnRight", "shift-e", "e-up") + + # Ship turns and slides are reversed from avatar walking + inputState.watch("shipSlideLeft", "q", "q-up") + inputState.watch("shipSlideLeft", "control-q", "q-up") + inputState.watch("shipSlideLeft", "shift-control-q", "q-up") + inputState.watch("shipSlideLeft", "alt-q", "alt-q-up") + inputState.watch("shipSlideLeft", "control-alt-q", "alt-q-up") + inputState.watch("shipSlideLeft", "shift-q", "q-up") + + inputState.watch("shipSlideRight", "e", "e-up") + inputState.watch("shipSlideRight", "control-e", "e-up") + inputState.watch("shipSlideRight", "shift-control-e", "e-up") + inputState.watch("shipSlideRight", "alt-e", "e-up") + inputState.watch("shipSlideRight", "control-alt-e", "e-up") + inputState.watch("shipSlideRight", "shift-e", "e-up") + + # Ship turns and slides are reversed from avatar walking + inputState.watch("shipTurnLeft", "a", "a-up") + inputState.watch("shipTurnLeft", "control-a", "a-up") + inputState.watch("shipTurnLeft", "shift-control-a", "a-up") + inputState.watch("shipTurnLeft", "alt-a", "alt-a-up") + inputState.watch("shipTurnLeft", "control-alt-a", "alt-a-up") + inputState.watch("shipTurnLeft", "shift-a", "a-up") + + inputState.watch("shipTurnRight", "d", "d-up") + inputState.watch("shipTurnRight", "control-d", "d-up") + inputState.watch("shipTurnRight", "shift-control-d", "d-up") + inputState.watch("shipTurnRight", "alt-d", "d-up") + inputState.watch("shipTurnRight", "control-alt-d", "d-up") + inputState.watch("shipTurnRight", "shift-d", "d-up") + # Jump controls if self.wantWASD: diff --git a/direct/src/controls/ShipPilot.py b/direct/src/controls/ShipPilot.py index e4e1f6ef56..82d15c4f8f 100755 --- a/direct/src/controls/ShipPilot.py +++ b/direct/src/controls/ShipPilot.py @@ -608,11 +608,11 @@ class ShipPilot(PhysicsWalker.PhysicsWalker): # get the button states: forward = inputState.isSet("forward") reverse = inputState.isSet("reverse") - turnLeft = inputState.isSet("turnLeft") - turnRight = inputState.isSet("turnRight") - slide = 0#inputState.isSet("slide") - slideLeft = 0#inputState.isSet("slideLeft") - slideRight = 0#inputState.isSet("slideRight") + turnLeft = inputState.isSet("shipTurnLeft") + turnRight = inputState.isSet("shipTurnRight") + slide = inputState.isSet("slide") + slideLeft = inputState.isSet("shipSlideLeft") + slideRight = inputState.isSet("shipSlideRight") jump = inputState.isSet("jump") # Determine what the speeds are based on the buttons: @@ -640,7 +640,7 @@ class ShipPilot(PhysicsWalker.PhysicsWalker): #self.__slideSpeed=slide and ( # (turnLeft and -avatarSlideSpeed) or # (turnRight and avatarSlideSpeed)) - self.__slideSpeed=( + self.__slideSpeed=(forward or reverse) and ( (slideLeft and -avatarSlideSpeed) or (slideRight and avatarSlideSpeed)) self.__rotationSpeed=not slide and (