Змея / Говнокод #29149 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
def animate_fight (self, игрок):
       if self.gamedata.animate_fight == True: 
          
          if self.gamedata.fight_animation_progress < 3:
           self.gamedata.screen.blit(self.fight1, (self.x - (self.width // 2), self.y - (self.width //2) ))
           
          elif 3 <= self.gamedata.fight_animation_progress < 6:
           self.gamedata.screen.blit(self.fight2, (self.x - (self.width // 2), self.y - (self.width //2) ))

          elif  6 <= self.gamedata.fight_animation_progress < 9:
           self.gamedata.screen.blit(self.fight3, (self.x - (self.width // 2), self.y - (self.width //2) ))
           self.gamedata.screen.blit(self.fight1, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
          elif  9 <= self.gamedata.fight_animation_progress < 12:
           self.gamedata.screen.blit(self.fight4, (self.x - (self.width // 2), self.y - (self.width //2) ))
           self.gamedata.screen.blit(self.fight2, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
          elif  12 <= self.gamedata.fight_animation_progress < 15:
           self.gamedata.screen.blit(self.fight5, (self.x - (self.width // 2), self.y - (self.width //2) ))
           self.gamedata.screen.blit(self.fight3, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
          elif  15 <= self.gamedata.fight_animation_progress < 18:
           self.gamedata.screen.blit(self.fight6, (self.x - (self.width // 2), self.y - (self.width //2) ))
           self.gamedata.screen.blit(self.fight4, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
          elif  18 <= self.gamedata.fight_animation_progress < 21:
             self.gamedata.screen.blit(self.fight5, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))

          elif  21 <= self.gamedata.fight_animation_progress < 24:
             self.gamedata.screen.blit(self.fight6, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
           
          elif  24 <=self.gamedata.fight_animation_progress:
             self.gamedata.animating = False
             self.gamedata.fight_animation_progress = 0
             self.gamedata.animate_fight = False
          if 24 > self.gamedata.fight_animation_progress:
           self.gamedata.fight_animation_progress += 1

Зачем делить на 3, если можно написать кучу говна?

Запостил: 1004w 1004w, (Updated )

Комментарии (2) RSS

  • Напомнило

    --В нашей стране живет 8.2 миллиона котов!
    --Как посчитано?
    --1, 2, 3, 4 и так далее
    Ответить
  • Да, если поля self.fight1... self.fight6 заменить массивом, цепочку ифов можно заменить одним вызовом.

    Конечно, несколько сравнений останется, но будет легче.
    Ответить

Добавить комментарий

Из-за тебя ушел bormand, guest!

    А не использовать ли нам bbcode?


    8