mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
added run
This commit is contained in:
parent
00dbb1617b
commit
579ca6f9eb
@ -27,6 +27,8 @@ class ControlManager:
|
||||
self.currentControls = None
|
||||
self.isEnabled = 1
|
||||
#self.monitorTask = taskMgr.add(self.monitor, "ControlManager-%s"%(id(self)), priority=-1)
|
||||
inputState.watch("run", "running-on", "running-off")
|
||||
|
||||
inputState.watch("forward", "arrow_up", "arrow_up-up")
|
||||
inputState.watch("forward", "control-arrow_up", "control-arrow_up-up")
|
||||
inputState.watch("forward", "alt-arrow_up", "alt-arrow_up-up")
|
||||
|
@ -436,6 +436,7 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
Check on the arrow keys and update the avatar.
|
||||
"""
|
||||
# get the button states:
|
||||
run = inputState.isSet("run")
|
||||
forward = inputState.isSet("forward")
|
||||
reverse = inputState.isSet("reverse")
|
||||
turnLeft = inputState.isSet("turnLeft")
|
||||
@ -445,6 +446,8 @@ class GravityWalker(DirectObject.DirectObject):
|
||||
# Determine what the speeds are based on the buttons:
|
||||
self.speed=(forward and self.avatarControlForwardSpeed or
|
||||
reverse and -self.avatarControlReverseSpeed)
|
||||
if run and self.speed>0.0:
|
||||
self.speed*=2.0 #*#
|
||||
# Should fSlide be renamed slideButton?
|
||||
self.slideSpeed=slide and (
|
||||
(turnLeft and -self.avatarControlForwardSpeed) or
|
||||
|
Loading…
x
Reference in New Issue
Block a user