From 36074ae38f77490463f7c2e9d5e1b2eb7cd278a4 Mon Sep 17 00:00:00 2001 From: "Hannes F. Kuchelmeister" Date: Fri, 5 Nov 2021 22:21:09 +0100 Subject: [PATCH] add vacuum cable Co-authored-by: Laura Januleviciute --- Vacuum.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Vacuum.py b/Vacuum.py index 94f3a4c..e37c2f0 100644 --- a/Vacuum.py +++ b/Vacuum.py @@ -8,12 +8,18 @@ class Vacuum: self.posY = -50 self.width = 124 self.height = 57 + self.tube_width = 10 self.bubble_objects = bubble_objects self.image = pygame.image.load("sprites/vacuum.png") def draw(self, screen): screen.blit(self.image, (self.posX, self.posY)) - + pygame.draw.line(screen, + (255, 0,0 ), + (400,600), + (self.posX + (self.width - self.tube_width) / 2 , self.posY + self.height), + width=self.tube_width) + def update(self, screen): x, y = pygame.mouse.get_pos() self.posX = x -(self.width / 2)