1 from operationscore.Behavior import *
2 import util.Geo as Geo
4 """XYMove is a behavior designed to be used as a recursive hook to ResponseMover to move pixels by
5 XStep and YStep. As XStep and YStep are maintained in the responses itself, they can be
6 modulated to facilitate, acceleration, modulation, bouncing, etc. Specify:
7 <XStep> -- the starting XStep
8 <YStep> -- the starting YStep
9 """
10
12 ret = []
13 for loc in sensor:
14 oploc = dict(loc)
15 self.insertStepIfMissing(oploc)
16 oploc['Location'] = Geo.addLocations((oploc['XStep'], oploc['YStep']), oploc['Location'])
17 ret.append(oploc)
18 return (ret, [])
20 if not 'XStep' in data:
21 data['XStep'] = self['XStep']
22 if not 'YStep' in data:
23 data['YStep'] = self['YStep']
24