mirror of
https://github.com/13hannes11/outyard-hackathon-rush-hour-co2.git
synced 2024-09-03 20:10:59 +02:00
add titlescreen background
Co-authored-by: Laura Januleviciute <januleviciute.laura@gmail.com>
This commit is contained in:
18
main.py
18
main.py
@@ -11,6 +11,8 @@ from Bicycle import Bicycle
|
|||||||
pygame.init()
|
pygame.init()
|
||||||
pygame.font.init()
|
pygame.font.init()
|
||||||
|
|
||||||
|
TITLE_SCREEN = True
|
||||||
|
|
||||||
SCREEN_WIDTH = 800
|
SCREEN_WIDTH = 800
|
||||||
SCREEN_HEIGHT = 600
|
SCREEN_HEIGHT = 600
|
||||||
|
|
||||||
@@ -51,6 +53,22 @@ for i in range(3, 6):
|
|||||||
vacuum = Vacuum(bubble_objects)
|
vacuum = Vacuum(bubble_objects)
|
||||||
bicycle = Bicycle(0, SCREEN_HEIGHT - 40)
|
bicycle = Bicycle(0, SCREEN_HEIGHT - 40)
|
||||||
|
|
||||||
|
|
||||||
|
TITLE_IMAGE = pygame.image.load("sprites/title_screen.png")
|
||||||
|
|
||||||
|
while TITLE_SCREEN:
|
||||||
|
SCREEN.fill(BACKGROUND)
|
||||||
|
|
||||||
|
for event in pygame.event.get():
|
||||||
|
if event.type == QUIT:
|
||||||
|
pygame.quit()
|
||||||
|
sys.exit()
|
||||||
|
if event.type == pygame.KEYDOWN or event.type == pygame.MOUSEBUTTONDOWN:
|
||||||
|
TITLE_SCREEN = False
|
||||||
|
SCREEN.blit(TITLE_IMAGE, (0, 0))
|
||||||
|
pygame.display.flip()
|
||||||
|
CLOCK.tick(30)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
SCREEN.fill(BACKGROUND)
|
SCREEN.fill(BACKGROUND)
|
||||||
pygame.display.set_caption("Rush Hour CO2")
|
pygame.display.set_caption("Rush Hour CO2")
|
||||||
|
|||||||
BIN
sprites/title_screen.png
Normal file
BIN
sprites/title_screen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
Reference in New Issue
Block a user