mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
ship slide left/right
This commit is contained in:
parent
b3d54ed848
commit
66c1e93888
@ -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:
|
||||
|
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user