coding_giants

lesson 8 Apple

Mar 15th, 2023 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
Add Comment
Please, Sign In to add comment