-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
66 lines (44 loc) · 1.37 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import pygame
from sys import exit
from level import *
import player
from settings import *
from npc import *
import random
#Icon
img = pygame.image.load('Assets/2022.png')
pygame.display.set_icon(img)
#DISPLAY SETTINGS
WIN = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT))
pygame.display.set_caption("BRH2022 Gabe Goes Green")
class Game(object):
def __init__(self):
pygame.init()
pygame.mixer.music.load('test.mp3')
pygame.mixer.music.play(-1)
self.clock = pygame.time.Clock()
self.level = level.Level()
self.fish = 0
def main(self):
clock = pygame.time.Clock()
run = True
while run:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
exit()
dt = self.clock.tick() / 1000
self.level.run(dt)
if self.level.mini == 2:
if self.fish == 0:
print('hi')
self.fish = Fishgame()
self.fish.run(WIN,dt,clock)
self.level.mini =0
print('r')
pygame.display.update()
if __name__ == "__main__": # only runs this file if this file is run directly
game = Game()
game.main()