mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
trying to get strafing working again for pirates battle
This commit is contained in:
parent
13ab99c29f
commit
8f74f5eaaf
@ -42,7 +42,7 @@ class BattleWalker(GravityWalker.GravityWalker):
|
|||||||
reverse = inputState.isSet("reverse")
|
reverse = inputState.isSet("reverse")
|
||||||
turnLeft = inputState.isSet("turnLeft")
|
turnLeft = inputState.isSet("turnLeft")
|
||||||
turnRight = inputState.isSet("turnRight")
|
turnRight = inputState.isSet("turnRight")
|
||||||
slide = 0 #hack -- was: inputState.isSet("slide")
|
slide = inputState.isSet("slide")
|
||||||
jump = inputState.isSet("jump")
|
jump = inputState.isSet("jump")
|
||||||
# Determine what the speeds are based on the buttons:
|
# Determine what the speeds are based on the buttons:
|
||||||
self.advanceSpeed=(forward and self.avatarControlForwardSpeed or
|
self.advanceSpeed=(forward and self.avatarControlForwardSpeed or
|
||||||
@ -52,6 +52,7 @@ class BattleWalker(GravityWalker.GravityWalker):
|
|||||||
# Should fSlide be renamed slideButton?
|
# Should fSlide be renamed slideButton?
|
||||||
self.slideSpeed=.15*(turnLeft and -self.avatarControlForwardSpeed or
|
self.slideSpeed=.15*(turnLeft and -self.avatarControlForwardSpeed or
|
||||||
turnRight and self.avatarControlForwardSpeed)
|
turnRight and self.avatarControlForwardSpeed)
|
||||||
|
print 'slideSpeed: ', self.slideSpeed
|
||||||
self.rotationSpeed=0
|
self.rotationSpeed=0
|
||||||
self.speed=0
|
self.speed=0
|
||||||
|
|
||||||
@ -119,6 +120,7 @@ class BattleWalker(GravityWalker.GravityWalker):
|
|||||||
if self.moving:
|
if self.moving:
|
||||||
distance = dt * self.speed
|
distance = dt * self.speed
|
||||||
slideDistance = dt * self.slideSpeed
|
slideDistance = dt * self.slideSpeed
|
||||||
|
print 'slideDistance: ', slideDistance
|
||||||
rotation = dt * self.rotationSpeed
|
rotation = dt * self.rotationSpeed
|
||||||
|
|
||||||
# Take a step in the direction of our previous heading.
|
# Take a step in the direction of our previous heading.
|
||||||
|
@ -123,6 +123,22 @@ class ControlManager:
|
|||||||
inputState.watch("turnRight", "control-alt-d", "d-up")
|
inputState.watch("turnRight", "control-alt-d", "d-up")
|
||||||
inputState.watch("turnRight", "shift-d", "d-up")
|
inputState.watch("turnRight", "shift-d", "d-up")
|
||||||
|
|
||||||
|
inputState.watch("slideLeft", "q", "q-up")
|
||||||
|
inputState.watch("slideLeft", "control-q", "q-up")
|
||||||
|
inputState.watch("slideLeft", "shift-control-q", "q-up")
|
||||||
|
inputState.watch("slideLeft", "alt-q", "q-up")
|
||||||
|
inputState.watch("slideLeft", "control-alt-q", "q-up")
|
||||||
|
inputState.watch("slideLeft", "shift-q", "q-up")
|
||||||
|
|
||||||
|
inputState.watch("slideRight", "e", "e-up")
|
||||||
|
inputState.watch("slideRight", "control-e", "e-up")
|
||||||
|
inputState.watch("slideRight", "shift-control-e", "e-up")
|
||||||
|
inputState.watch("slideRight", "alt-e", "e-up")
|
||||||
|
inputState.watch("slideRight", "control-alt-e", "e-up")
|
||||||
|
inputState.watch("slideRight", "shift-e", "e-up")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def add(self, controls, name="basic"):
|
def add(self, controls, name="basic"):
|
||||||
"""
|
"""
|
||||||
controls is an avatar control system.
|
controls is an avatar control system.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user