View difference between Paste ID: Dfccz0B8 and dnuRn3Fb
SHOW: | | - or go back to the newest paste.
1
import pygame
2
import copy
3
4
5
class Segment(pygame.sprite.Sprite):
6
    def __init__(self):
7
        super().__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