- def update(self, elapsedTime, centerPosition):
- '''
- Update the cursor's look and position
-
- elapsedTime:
- The time passed since the previous update
- centerPosition:
- the new position of the creep
- '''
- self._updateImage(elapsedTime)
- self.centerPosition = centerPosition
- if self.flashing :
- self._flashTimer += elapsedTime
- if self._flashTimer > self.flashLength:
- self.flashing = False
+ def _startBlink(self) :
+ pygame.time.set_timer(TIMEOUT, self.duration)
+ self.iterator = self.iterImages()
+
+ def iterImages(self) :
+ for img in cycle(self.images) :
+ yield img
+
+ @event_handler(TIMEOUT)
+ def loadNext(self, event) :
+ self.image = self.iterator.next()
+ surface = pygame.display.get_surface()
+ surface.blit(self.image, self.rect)
+
+ def update(self) :
+ print 'cursor update'
+
+# def update(self, elapsedTime, centerPosition):
+# '''
+# Update the cursor's look and position
+#
+# elapsedTime:
+# The time passed since the previous update
+# centerPosition:
+# the new position of the creep
+# '''
+# self._updateImage(elapsedTime)
+# self.centerPosition = centerPosition
+# if self.flashing :
+# self._flashTimer += elapsedTime
+# if self._flashTimer > self.flashLength:
+# self.flashing = False