add gameover screen and change colors

Co-authored-by: Laura Januleviciute <januleviciute.laura@gmail.com>
This commit is contained in:
2021-11-05 20:23:51 +01:00
parent 4f5c521359
commit e10d862180
3 changed files with 8 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import pygame
import random import random
class Bubble: class Bubble:
def __init__(self, posX, posY, radius = 1, color=(0,0,0), direction=(1,1)): def __init__(self, posX, posY, radius = 1, color=(0,0,255), direction=(1,1)):
self.posX = posX self.posX = posX
self.posY = posY self.posY = posY
self.radius = radius self.radius = radius

2
Car.py
View File

@@ -3,7 +3,7 @@ import random
from Bubble import Bubble from Bubble import Bubble
class Car: class Car:
def __init__(self, posX, posY, height, width, game_objects, color=(0,0,0), directionX=1): def __init__(self, posX, posY, height, width, game_objects, color=(0, 255,0), directionX=1):
self.posX = posX self.posX = posX
self.posY = posY self.posY = posY
self.color = color self.color = color

View File

@@ -7,11 +7,14 @@ from Car import Car
from Vacuum import Vacuum from Vacuum import Vacuum
pygame.init() pygame.init()
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
BUBBLE_LIMIT = 1000
SCREEN = pygame.display.set_mode((800,600)) BUBBLE_LIMIT = 100
BACKGROUND = (255,255,255)
SCREEN = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
BACKGROUND = (0,0,0)
SCREEN.fill(BACKGROUND) SCREEN.fill(BACKGROUND)
CLOCK = pygame.time.Clock() CLOCK = pygame.time.Clock()