From 82f99fc4583ca3cc9861a9fe30990a4a9ef162c4 Mon Sep 17 00:00:00 2001 From: eugue Date: Tue, 25 Jan 2011 15:22:24 -0500 Subject: working version of IconMover --- behaviors/MoveBehavior.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'behaviors') diff --git a/behaviors/MoveBehavior.py b/behaviors/MoveBehavior.py index 9ae98b9..590f0e4 100644 --- a/behaviors/MoveBehavior.py +++ b/behaviors/MoveBehavior.py @@ -5,21 +5,19 @@ import util.Strings as Strings class MoveBehavior(Behavior): def processResponse(self, sensorInputs, recursiveInputs): - print 'processing' - print sensorInputs if recursiveInputs: currRecLocs = recursiveInputs else: - currRecLocs = [{'Location' : (5, 5)), 'Color' : [255, 255, 255]}] + currRecLocs = [{'Location' : (5, 5), 'Color' : [255, 255, 255]}] if sensorInputs: # if input exists, change location ret = [] for currRecLoc in currRecLocs: currDict = dict(currRecLoc) for sensorInput in sensorInputs: - currDict['Location'][0] += sensorInput['x'] * self['XStep'] - currDict['Location'][1] += sensorInput['y'] * self['YStep'] - #currDict['Color'] = sensorInput['color'] + currDict['Location'] = (currDict['Location'][0] - sensorInput['x'] * self['XStep'], \ + currDict['Location'][1] + sensorInput['y'] * self['YStep']) + currDict['Color'] = [sensorInput['r'], sensorInput['g'], sensorInput['b']] ret.append(currDict) #print ret return (ret, ret) -- cgit v1.2.3