Esempio n. 1
0
 def __init__(self) :
     GridRole.__init__(self)
     self.currentSpeed = 0 # Number of pixels to move per tick when dx or dy are non zero.
     self.dx = 0 # -1, 0 or 1 depending on direction of travel
     self.dy = 0 # -1, 0 or 1 depending on direction of travel.
     self.between = 0 # Distance travelled between squares (0..squareSize)
     self.squashed = False # Set to false when started to move and set to true just before onInvaded is called.
Esempio n. 2
0
 def onSceneCreated(self):
     GridRole.onSceneCreated(self)
     
     self.makeAlternateOccupant()
     self.addTag("squashN")
     self.addTag("squashS")
     self.addTag("squashE")
     self.addTag("squashW")
Esempio n. 3
0
 def __init__(self) :
     GridRole.__init__(self)
     self.fromCostume = None
     self.toCostume = None
     self.fromDX = 1
     self.fromDY = 0
     self.offsetX = 0
     self.offsetY = 0
     self.pregnant = False # Are we ready to give birth to an object?
     self.pulled = False # Tells onInvaded that the invading object was pulled in, and should be transmuted.
Esempio n. 4
0
 def onSceneCreated(self):
     GridRole.onSceneCreated(self)
     self.makeAlternateOccupant()
     self.costumeFeatures.update(self)
     
     dummy = None
     squareSize = self.square.grid.squareSize
     # Create a dummy actor if we are a wide machine
     pose = self.actor.appearance.pose
     if pose.surface.width > squareSize :
         if pose.offsetX > squareSize :
             dummy = Dummy(self, -1, 0)
         else :
             dummy = Dummy(self, 1, 0)
 
     if dummy :
         dummy.makeAlternateOccupant()        
Esempio n. 5
0
 def __init__(self) :
     GridRole.__init__(self)
     self.destinationId = ""
     self.working = False