diff options
author | eugue <eug.sun@gmail.com> | 2011-01-28 16:10:58 -0500 |
---|---|---|
committer | eugue <eug.sun@gmail.com> | 2011-01-28 16:10:58 -0500 |
commit | 51b0d5f0cd4524a977e0bf48ca6f643d85d05d00 (patch) | |
tree | 5f1f0c33c033eaad3c4a901c50d1cdb463c09c42 /behaviors | |
parent | 3cf7f82b2c88181925e01c2736e13d8be7574ab9 (diff) |
reverted the effort to take string inputs.
Diffstat (limited to 'behaviors')
-rw-r--r-- | behaviors/MoveBehavior.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/behaviors/MoveBehavior.py b/behaviors/MoveBehavior.py index 6f57437..6e7fc6a 100644 --- a/behaviors/MoveBehavior.py +++ b/behaviors/MoveBehavior.py @@ -13,22 +13,21 @@ class MoveBehavior(Behavior): else: currRecLocs = [{'Location' : (5, 5), 'Color' : [255, 255, 255]}] - #print sensorInputs if sensorInputs: # if input exists, change location ret = [] for currRecLoc in currRecLocs: currDict = dict(currRecLoc) for sensorInput in sensorInputs: - if 'type' in sensorInput and int(sensorInput['type']) == 1: - #currDict['Shake'] = 0 - currDict['Location'] = (currDict['Location'][0] - int(sensorInput['x']) * self['XStep'], \ - currDict['Location'][1] + int(sensorInput['y']) * self['YStep']) - currDict['Color'] = [int(sensorInput['r']), int(sensorInput['g']), int(sensorInput['b'])] - elif int(sensorInput['type']) == 2: - #print sensorInput + if 'type' in sensorInput and sensorInput['type'] == 1: + currDict['Shake'] = 0 + currDict['Location'] = (currDict['Location'][0] - sensorInput['x'] * self['XStep'], \ + currDict['Location'][1] + sensorInput['y'] * self['YStep']) + currDict['Color'] = [sensorInput['r'], sensorInput['g'], sensorInput['b']] + elif sensorInput['type'] == 2: currDict['Shake'] = 1 #currDict['Force'] = sensorInput['force'] ret.append(currDict) + #print ret return (ret, ret) else: # if not, return current recursive location. |