-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
45 lines (35 loc) · 1.11 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import pygame
import time
import Ranking
from maps import Map
Ranking.SetUsername()
pygame.init()
pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=256)
pygame.mixer.music.load('Audio/background_music.mp3')
pygame.mixer.music.set_volume(0.1)
pygame.mixer.music.play(-1)
game_map = Map()
while not game_map.windowClosed:
pygame.time.Clock().tick(30)
game_map.screen.fill((255, 255, 255))
if game_map.initialScreen:
game_map.initalScreen()
elif game_map.selectScreen:
game_map.playerAndMapScreen()
elif game_map.instructionsScreen:
game_map.instructionScreen()
elif game_map.inGame:
game_map.blitBackgroundMap()
game_map.player.animatePlayerSprite()
game_map.shotsInteractions()
game_map.bulletsInteractions()
game_map.lifeInteractions()
game_map.monstersInteractions()
game_map.generateMonsters()
game_map.generateBarriers()
game_map.barriersInteractions()
game_map.showPlayerInfos()
pygame.display.update()
else:
game_map.endOfGame()
game_map.checkEvents()