View difference between Paste ID: XtLGLuZU and TxesK2Yp
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().__init__()
8
        self.image = pygame.image.load("images/apple.png")
9
        self.rect = pygame.Rect(
10
            random.randint(0, 24)*32,
11
            random.randint(0, 18)*32,
12
            32,
13
            32
14
        )
15