Advertisement
Redomine

snake

Aug 3rd, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. x = 450
  2. y = 450
  3. radius = 90
  4.  
  5.  
  6. class snake:
  7.  
  8. def __init__(self):
  9. global x, y
  10. self.dickbags_number = 1
  11. if current_direction == 'left': self.sortament_of_dickbags = [[x+radius], [y]]
  12. if current_direction == 'right': self.sortament_of_dickbags = [[x-radius], [y]]
  13. if current_direction == 'up': self.sortament_of_dickbags = [[x], [y-radius]]
  14. if current_direction == 'up': self.sortament_of_dickbags = [[x], [y+radius]]
  15.  
  16. def add(self):
  17. global s, x, y
  18. self.dickbags_number += 1
  19. self.sortament_of_dickbags.append([x - radius
  20. * self.dickbags_number])
  21. self.sortament_of_dickbags.append([y - radius
  22. * self.dickbags_number])
  23.  
  24. def current_tail(self):
  25. return self.sortament_of_dickbags
  26.  
  27.  
  28. a = snake()
  29. a.add()
  30. a.add()
  31. a.add()
  32. a.add()
  33. a.add()
  34. print a.current_tail()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement