Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ripRoboto(self, pronounceDead):
- # This if condition will keep running as long as deadCycleCount is below the ((len(deadImages) - 1) * 8) - 1.
- # deadCycleCount increments every time this function runs and the if condition is satisfied. This means that
- # once deadCycleCount is equal to ((len(deadImages) - 1) * 8) - 1, the code in the if statement will stop
- # running. deadCycleCount will reset in the resetRoboto function.
- if self.deadCycleCount < ((len(deadImages) - 1) * 8) - 1 and self.gotShot:
- self.deadCycleCount += 1 # increment deadCycleCount by 1
- self.y = 600 - 155 - (130 / 2)
- if self.direction == "right":
- self.currentPlayer = pygame.transform.scale(deadImages[self.deadCycleCount // 8],
- (self.width, self.height))
- else:
- self.currentPlayer = leftImageMode(pygame.transform.scale(deadImages[self.deadCycleCount // 8],
- (self.width, self.height)))
- elif not pronounceDead:
- self.isDead = True
- def resetRoboto(self):
- self.isDead = False
- self.gotShot = False
- self.deadCycleCount = 0 # deadCycleCount resets to 0 for the next time ripRoboto runs
- self.hasRestarted = True
- self.updateBounds()
- self.currentDirection = "right"
Add Comment
Please, Sign In to add comment