More work and fixes on the bonus.
This commit is contained in:
parent
69d4316067
commit
c8e9033508
11
monkeyspank
11
monkeyspank
@ -13,9 +13,11 @@ pygame.mixer.set_reserved(2)
|
||||
|
||||
def butthead_taunt(sounds):
|
||||
global bonus
|
||||
global bonusTime
|
||||
global points
|
||||
play_random(sounds, "butt-head")
|
||||
bonus = True
|
||||
bonusTime = time.time()
|
||||
|
||||
def monkey_taunt():
|
||||
t = pygame.mixer.Channel(1)
|
||||
@ -47,6 +49,7 @@ def player_action(monkey, reaction):
|
||||
def game(mode):
|
||||
pygame.mixer.music.pause()
|
||||
global bonus
|
||||
global bonusTime
|
||||
bonusTime = int(time.time())
|
||||
encourage = int(time.time())
|
||||
lose = False
|
||||
@ -95,15 +98,14 @@ def game(mode):
|
||||
if lose == True: continue
|
||||
taunt = monkey_taunt()
|
||||
timeOut = time.time()
|
||||
elif (event.key == pygame.K_SPACE) and (bonus == True):
|
||||
bonus == False
|
||||
elif event.key == pygame.K_SPACE and bonus == True:
|
||||
bonus = False
|
||||
points += 100
|
||||
k = pygame.mixer.Channel(0)
|
||||
k.play(sounds['kick-hit'])
|
||||
pygame.event.clear()
|
||||
if bonusTime - time.time() > 0.75:
|
||||
if time.time() - bonusTime > 0.85:
|
||||
bonus = False
|
||||
bonusTime = time.time()
|
||||
totalTime = time.time()
|
||||
if int(time.time()) - encourage == 8:
|
||||
if random.randrange(0, 5) < 2:
|
||||
@ -134,6 +136,7 @@ def game(mode):
|
||||
mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game")
|
||||
while mode != "exit_game":
|
||||
bonus = False
|
||||
bonusTime = time.time()
|
||||
spanks = 0
|
||||
points = 0
|
||||
if mode == "menu": mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game")
|
||||
|
Loading…
Reference in New Issue
Block a user