Solved another merge conflict
commit
ce515a898d
15
game.py
15
game.py
|
@ -27,6 +27,7 @@ class TheGame:
|
||||||
|
|
||||||
pygame.display.set_caption('Pin Avo, the Cado!')
|
pygame.display.set_caption('Pin Avo, the Cado!')
|
||||||
|
|
||||||
|
|
||||||
def initialize_screen(self):
|
def initialize_screen(self):
|
||||||
displayInfo = pygame.display.Info()
|
displayInfo = pygame.display.Info()
|
||||||
zoom = 1.3
|
zoom = 1.3
|
||||||
|
@ -68,19 +69,9 @@ class TheGame:
|
||||||
self.click = pygame.mixer.Sound("audio/click.wav")
|
self.click = pygame.mixer.Sound("audio/click.wav")
|
||||||
return self.click
|
return self.click
|
||||||
|
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
pygame.init()
|
|
||||||
try:
|
|
||||||
pygame.mixer.init()
|
|
||||||
pygame.mixer.music.set_volume(0.5)
|
|
||||||
noSound = False
|
|
||||||
except:
|
|
||||||
print("DEBUG :: Y U NO sound? :(")
|
|
||||||
noSound = True
|
|
||||||
|
|
||||||
pygame.display.set_caption('Pin Avo, the Cado!')
|
|
||||||
clock = pygame.time.Clock()
|
clock = pygame.time.Clock()
|
||||||
|
|
||||||
size = (800, 600)
|
size = (800, 600)
|
||||||
bg = pygame.image.load("img/background.png")
|
bg = pygame.image.load("img/background.png")
|
||||||
desired_fps = 15
|
desired_fps = 15
|
||||||
|
@ -91,6 +82,7 @@ class TheGame:
|
||||||
levelChange = 0
|
levelChange = 0
|
||||||
reachScore = 200
|
reachScore = 200
|
||||||
font = pygame.font.Font(None, 60)
|
font = pygame.font.Font(None, 60)
|
||||||
|
avoClick = game.loadClick()
|
||||||
|
|
||||||
# I don't know, should we move this text out of the way?
|
# I don't know, should we move this text out of the way?
|
||||||
game_over = font.render('GAME OVER', 0, RED)
|
game_over = font.render('GAME OVER', 0, RED)
|
||||||
|
@ -172,6 +164,7 @@ class TheGame:
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
# Collision detection
|
# Collision detection
|
||||||
if event.type == MOUSEBUTTONDOWN:
|
if event.type == MOUSEBUTTONDOWN:
|
||||||
|
avoClick.play()
|
||||||
for avo in avocados:
|
for avo in avocados:
|
||||||
hit = avo.isHit(pygame.mouse.get_pos())
|
hit = avo.isHit(pygame.mouse.get_pos())
|
||||||
if hit:
|
if hit:
|
||||||
|
|
Loading…
Reference in New Issue