trying to get strafing working again for pirates battle

This commit is contained in:
Joe Shochet 2005-10-05 04:57:15 +00:00
parent 13ab99c29f
commit 8f74f5eaaf
2 changed files with 20 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class BattleWalker(GravityWalker.GravityWalker):
reverse = inputState.isSet("reverse")
turnLeft = inputState.isSet("turnLeft")
turnRight = inputState.isSet("turnRight")
slide = 0 #hack -- was: inputState.isSet("slide")
slide = inputState.isSet("slide")
jump = inputState.isSet("jump")
# Determine what the speeds are based on the buttons:
self.advanceSpeed=(forward and self.avatarControlForwardSpeed or
@ -51,7 +51,8 @@ class BattleWalker(GravityWalker.GravityWalker):
self.advanceSpeed*=2.0 #*#
# Should fSlide be renamed slideButton?
self.slideSpeed=.15*(turnLeft and -self.avatarControlForwardSpeed or
turnRight and self.avatarControlForwardSpeed)
turnRight and self.avatarControlForwardSpeed)
print 'slideSpeed: ', self.slideSpeed
self.rotationSpeed=0
self.speed=0
@ -119,6 +120,7 @@ class BattleWalker(GravityWalker.GravityWalker):
if self.moving:
distance = dt * self.speed
slideDistance = dt * self.slideSpeed
print 'slideDistance: ', slideDistance
rotation = dt * self.rotationSpeed
# Take a step in the direction of our previous heading.

View File

@ -122,6 +122,22 @@ class ControlManager:
inputState.watch("turnRight", "alt-d", "d-up")
inputState.watch("turnRight", "control-alt-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"):
"""