Guest User

Untitled

a guest
Jun 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. def ripRoboto(self, pronounceDead):
  2. # This if condition will keep running as long as deadCycleCount is below the ((len(deadImages) - 1) * 8) - 1.
  3. # deadCycleCount increments every time this function runs and the if condition is satisfied. This means that
  4. # once deadCycleCount is equal to ((len(deadImages) - 1) * 8) - 1, the code in the if statement will stop
  5. # running. deadCycleCount will reset in the resetRoboto function.
  6. if self.deadCycleCount < ((len(deadImages) - 1) * 8) - 1 and self.gotShot:
  7. self.deadCycleCount += 1 # increment deadCycleCount by 1
  8. self.y = 600 - 155 - (130 / 2)
  9.  
  10. if self.direction == "right":
  11. self.currentPlayer = pygame.transform.scale(deadImages[self.deadCycleCount // 8],
  12. (self.width, self.height))
  13. else:
  14. self.currentPlayer = leftImageMode(pygame.transform.scale(deadImages[self.deadCycleCount // 8],
  15. (self.width, self.height)))
  16. elif not pronounceDead:
  17. self.isDead = True
  18.  
  19. def resetRoboto(self):
  20. self.isDead = False
  21. self.gotShot = False
  22. self.deadCycleCount = 0 # deadCycleCount resets to 0 for the next time ripRoboto runs
  23. self.hasRestarted = True
  24. self.updateBounds()
  25. self.currentDirection = "right"
Add Comment
Please, Sign In to add comment