ship slide left/right

This commit is contained in:
Dave Schuyler 2005-12-02 00:46:45 +00:00
parent b3d54ed848
commit 66c1e93888
2 changed files with 37 additions and 6 deletions

View File

@ -115,6 +115,37 @@ class ControlManager:
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:
inputState.watch("jump", "space", "space-up")

View File

@ -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 (