diff options
author | Dan <dan@rcoh-ubuntu-small.(none)> | 2011-01-25 00:33:46 -0500 |
---|---|---|
committer | Dan <dan@rcoh-ubuntu-small.(none)> | 2011-01-25 00:33:46 -0500 |
commit | eaaef5460a95d2de1dddc847f6c3bbcb2aef8047 (patch) | |
tree | 004f6e326959cb5d6bfcf0793686dab74260a3db /behaviors/Square.py | |
parent | 2019fb2895237aa9d86450daaf6d90831189fc13 (diff) |
Adding an OSC input.
Diffstat (limited to 'behaviors/Square.py')
-rw-r--r-- | behaviors/Square.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/behaviors/Square.py b/behaviors/Square.py index aef3622..ecd000c 100644 --- a/behaviors/Square.py +++ b/behaviors/Square.py @@ -2,11 +2,12 @@ from operationscore.Behavior import * class Square(Behavior): def processResponse(self, sensorInputs, recursiveInputs): for sensory in sensorInputs:#TODO: consider replicating the dict - xLoc = sensory['Location'][0] - yLoc = sensory['Location'][1] - width = self['Width'] - #sensory['Location'] = 'True' - sensory['Location'] =\ - '{x}<'+str(xLoc+width)+',{x}>'+str(xLoc-width)+\ - ',{y}<'+str(yLoc+width)+',{y}>'+str(yLoc-width) + if 'Location' in sensory: + xLoc = sensory['Location'][0] + yLoc = sensory['Location'][1] + width = self['Width'] + #sensory['Location'] = 'True' + sensory['Location'] =\ + '{x}<'+str(xLoc+width)+',{x}>'+str(xLoc-width)+\ + ',{y}<'+str(yLoc+width)+',{y}>'+str(yLoc-width) return (sensorInputs, recursiveInputs) |