- 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
-
- def _updateImage(self, elapsedTime):
- '''
- Update the cursor's image
-
- elapsedTime:
- The time passed since the previous update
- '''
- self._animationOffset += elapsedTime
-
- if self._animationOffset > self.duration :
- #New animation offset is computed first, before updating the pointer
- self._animationOffset -= self.duration
- #point to the next image (restarts from the beginning when it reaches the end)
- self._imagePointer = (self._imagePointer + 1) % len(self.images)
-
- if self.flashing:
- self.image = pygame.image.load(self.flashImagePath).convert_alpha()
- else :
- self.image = pygame.image.load(self.images[self._imagePointer]).convert_alpha()
-
- def flash(self,flashLength = None):
- self._flashTimer = 0
- self.flashing = True
- if flashLength:
- self.flashlength = flashLength
-
- def blit(self,surface):
- '''
- Draw the circle on surface
- '''
-
- newPos = (self.centerPosition[0] - self.image.get_width() / 2, self.centerPosition[1] - self.image.get_height() / 2)
- surface.blit(self.image, newPos)