add image for vacuum cleaner

Co-authored-by: Laura Januleviciute <januleviciute.laura@gmail.com>
This commit is contained in:
2021-11-05 22:12:11 +01:00
parent 82b9e6d255
commit 627d6594aa
3 changed files with 12 additions and 9 deletions

View File

@@ -6,13 +6,14 @@ class Vacuum:
def __init__(self, bubble_objects):
self.posX = -50
self.posY = -50
self.width = 50
self.height = 50
self.width = 124
self.height = 57
self.bubble_objects = bubble_objects
self.image = pygame.image.load("sprites/vacuum.png")
def draw(self, screen):
pygame.draw.rect(screen, (255, 0, 0), pygame.Rect(self.posX, self.posY, self.width, self.height))
screen.blit(self.image, (self.posX, self.posY))
def update(self, screen):
x, y = pygame.mouse.get_pos()
self.posX = x -(self.width / 2)