new pie-throwing interface
This commit is contained in:
parent
a2437a514d
commit
0be153797e
|
|
@ -58,7 +58,6 @@ class ControlManager:
|
|||
inputState.watch("jump", "shift-control", "shift-control-up")
|
||||
|
||||
inputState.watch("slide", "slide-is-disabled", "slide-is-disabled")
|
||||
inputState.watch("pie", "begin-pie", "end-pie")
|
||||
|
||||
#inputState.watch("slideLeft", "shift-arrow_left", "shift-arrow_left-up")
|
||||
#inputState.watch("slideLeft", "control-arrow_left", "control-arrow_left-up")
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class InputState(DirectObject.DirectObject):
|
|||
def set(self, name, isSet):
|
||||
assert(self.debugPrint("set(name=%s, isSet=%s)"%(name, isSet)))
|
||||
self.state[name] = isSet
|
||||
messenger.send(name, [isSet])
|
||||
|
||||
def isSet(self, name):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@ class NonPhysicsWalker(DirectObject.DirectObject):
|
|||
turnRight = inputState.isSet("turnRight")
|
||||
slide = inputState.isSet("slide")
|
||||
#jump = inputState.isSet("jump")
|
||||
pie = inputState.isSet("pie")
|
||||
# Determine what the speeds are based on the buttons:
|
||||
self.speed=(forward and self.avatarControlForwardSpeed or
|
||||
reverse and -self.avatarControlReverseSpeed)
|
||||
|
|
@ -164,12 +163,6 @@ class NonPhysicsWalker(DirectObject.DirectObject):
|
|||
self.rotationSpeed=not slide and (
|
||||
(turnLeft and self.avatarControlRotateSpeed) or
|
||||
(turnRight and -self.avatarControlRotateSpeed))
|
||||
|
||||
# No moving allowed while throwing a pie.
|
||||
if pie:
|
||||
self.speed = 0
|
||||
self.slideSpeed = 0
|
||||
self.rotationSpeed = 0
|
||||
|
||||
# How far did we move based on the amount of time elapsed?
|
||||
dt=min(ClockObject.getGlobalClock().getDt(), 0.1)
|
||||
|
|
|
|||
|
|
@ -415,7 +415,6 @@ class PhysicsWalker(DirectObject.DirectObject):
|
|||
slideLeft = inputState.isSet("slideLeft")
|
||||
slideRight = inputState.isSet("slideRight")
|
||||
jump = inputState.isSet("jump")
|
||||
pie = inputState.isSet("pie")
|
||||
# Determine what the speeds are based on the buttons:
|
||||
self.__speed=(forward and self.avatarControlForwardSpeed or
|
||||
reverse and -self.avatarControlReverseSpeed)
|
||||
|
|
@ -430,13 +429,6 @@ class PhysicsWalker(DirectObject.DirectObject):
|
|||
(turnLeft and self.avatarControlRotateSpeed) or
|
||||
(turnRight and -self.avatarControlRotateSpeed))
|
||||
|
||||
# No moving allowed while throwing a pie.
|
||||
if pie:
|
||||
self.__speed = 0
|
||||
self.__slideSpeed = 0
|
||||
self.__rotationSpeed = 0
|
||||
jump = 0
|
||||
|
||||
# How far did we move based on the amount of time elapsed?
|
||||
dt=min(ClockObject.getGlobalClock().getDt(), 0.1)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue