Klokova_Sofi

pygame breakout panel

Jun 4th, 2023
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import pygame
  2.  
  3. class Panel(pygame.sprite.Sprite):
  4.     def __init__(self, x, y, filename):
  5.         super().__init__()
  6.         self.image = pygame.image.load(filename)
  7.         self.rect = self.image.get_rect(topleft=(x, y))
  8.  
  9.     def update(self, screen, x, y):
  10.         self.rect = self.image.get_rect(topleft=(x, y))
  11.         screen.blit(self.image, self.rect)
Advertisement
Add Comment
Please, Sign In to add comment