diff options
Diffstat (limited to 'behaviors/RunningBehavior.py')
-rw-r--r-- | behaviors/RunningBehavior.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/behaviors/RunningBehavior.py b/behaviors/RunningBehavior.py index 255ce69..3d82d29 100644 --- a/behaviors/RunningBehavior.py +++ b/behaviors/RunningBehavior.py @@ -10,11 +10,13 @@ class RunningBehavior(Behavior): outDict = dict(recurInput) if not 'Dir' in outDict: outDict['Dir'] = 1 #to the right + if not 'StepSize' in outDict: + outDict['StepSize'] = self['StepSize'] outDict['Location']= Util.addLocations(outDict['Location'], - (self['StepSize']*outDict['Dir'],0)) + (outDict['StepSize']*outDict['Dir'],0)) if not Util.pointWithinBoundingBox(outDict['Location'], \ Util.getScreen().getSize()): - outDict['Dir'] *= -1 + outDict['Dir'] *= -1 ret.append(outDict) ret += newResponses return (ret, ret) |