Advertisement
ada1711

Untitled

Mar 14th, 2023
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import pygame
  2. import copy
  3.  
  4.  
  5. class Segment(pygame.sprite.Sprite):
  6. def __init__(self):
  7. super(Segment, self).__init__()
  8. self.image = pygame.image.load("images/segment.png")
  9. self.position = pygame.Rect(-32, -32, 32, 32)
  10. self.last_position = None
  11.  
  12. def shift(self, new_position):
  13. self.last_position = copy.deepcopy(self.position)
  14. self.position = copy.deepcopy(new_position)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement