View difference between Paste ID: TxesK2Yp and YTk2mMQk
SHOW: | | - or go back to the newest paste.
1
import pygame
2
import random
3
4
5
class Apple(pygame.sprite.Sprite):
6
    def __init__(self):
7-
        super(Apple, self).__init__()
7+
        super().__init__()
8
        self.image = pygame.image.load("images/apple.png")
9-
        random_position = pygame.Rect(
9+
        self.rect = pygame.Rect(
10-
            random.randrange(0, 24)*32,
10+
            random.randint(0, 24)*32,
11-
            random.randrange(1, 18)*32,
11+
            random.randint(0, 18)*32,
12
            32,
13
            32
14
        )
15-
        self.rect = random_position
15+