aboutsummaryrefslogtreecommitdiff
path: root/behaviors/RunningBehavior.py
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2010-12-20 15:42:13 -0500
committerGravatar rcoh <rcoh@mit.edu>2010-12-20 15:42:13 -0500
commita1d9b85320c9b07d62470d78ef0c5f9015baf813 (patch)
tree8df16aec8de793ba0f2e4b330b764a6f6a49f59a /behaviors/RunningBehavior.py
parent17577b1b19387b2cefb7ac777ed1323dd36be086 (diff)
parent2736307c1d6d67868ca54a3df951f9e959efedd0 (diff)
Merge branch 'master' into pixelregions
Conflicts: Util.py pixelmappers/SimpleMapper.py
Diffstat (limited to 'behaviors/RunningBehavior.py')
-rw-r--r--behaviors/RunningBehavior.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/behaviors/RunningBehavior.py b/behaviors/RunningBehavior.py
index 3d82d29..1969162 100644
--- a/behaviors/RunningBehavior.py
+++ b/behaviors/RunningBehavior.py
@@ -1,4 +1,6 @@
from operationscore.Behavior import *
+import util.ComponentRegistry as compReg
+import util.Geo as Geo
import pdb
import Util
class RunningBehavior(Behavior):
@@ -12,10 +14,10 @@ class RunningBehavior(Behavior):
outDict['Dir'] = 1 #to the right
if not 'StepSize' in outDict:
outDict['StepSize'] = self['StepSize']
- outDict['Location']= Util.addLocations(outDict['Location'],
+ outDict['Location']= Geo.addLocations(outDict['Location'],
(outDict['StepSize']*outDict['Dir'],0))
- if not Util.pointWithinBoundingBox(outDict['Location'], \
- Util.getScreen().getSize()):
+ if not Geo.pointWithinBoundingBox(outDict['Location'], \
+ compReg.getComponent('Screen').getSize()):
outDict['Dir'] *= -1
ret.append(outDict)
ret += newResponses