From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.behaviors.MoveBehavior-pysrc.html | 148 ++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 html/SmootLight.behaviors.MoveBehavior-pysrc.html (limited to 'html/SmootLight.behaviors.MoveBehavior-pysrc.html') diff --git a/html/SmootLight.behaviors.MoveBehavior-pysrc.html b/html/SmootLight.behaviors.MoveBehavior-pysrc.html new file mode 100644 index 0000000..30fe34c --- /dev/null +++ b/html/SmootLight.behaviors.MoveBehavior-pysrc.html @@ -0,0 +1,148 @@ + + + + + SmootLight.behaviors.MoveBehavior + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module MoveBehavior + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.MoveBehavior

+
+ 1  from operationscore.Behavior import * 
+ 2  #import util.ComponentRegistry as compReg 
+ 3  #import util.Geo as Geo 
+ 4  #import util.Strings as Strings 
+ 5   
+
6 -class MoveBehavior(Behavior): +
7 """Moves current location by the x and y components of sensorInput. Uses recurrences to track + 8 current input. @Author: Euguene""" + 9 +
10 - def processResponse(self, sensorInputs, recursiveInputs): +
11 if recursiveInputs: +12 currRecLocs = recursiveInputs +13 else: +14 currRecLocs = [{'Location' : (5, 5), 'Color' : [255, 255, 255]}] +15 +16 if sensorInputs: # if input exists, change location +17 ret = [] +18 for currRecLoc in currRecLocs: +19 currDict = dict(currRecLoc) +20 for sensorInput in sensorInputs: +21 if 'type' in sensorInput and sensorInput['type'] == 1: +22 currDict['Shake'] = 0 +23 currDict['Location'] = (currDict['Location'][0] - sensorInput['x'] * self['XStep'], \ +24 currDict['Location'][1] + sensorInput['y'] * self['YStep']) +25 currDict['Color'] = [sensorInput['r'], sensorInput['g'], sensorInput['b']] +26 elif sensorInput['type'] == 2: +27 currDict['Shake'] = 1 +28 #currDict['Force'] = sensorInput['force'] +29 ret.append(currDict) +30 #print ret +31 return (ret, ret) +32 +33 else: # if not, return current recursive location. +34 #print currRecLocs +35 return (currRecLocs, currRecLocs) +
36 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3