From a4005de0f0f34d8a36c19a1a889e9a5c155b2384 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 8 Dec 2019 14:11:28 -0500 Subject: [PATCH] Added bonuses possibilities to the game. --- files/instructions.txt | 2 ++ monkeyspank | 23 ++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/files/instructions.txt b/files/instructions.txt index 52c97f2..2936752 100644 --- a/files/instructions.txt +++ b/files/instructions.txt @@ -4,3 +4,5 @@ Use the arrow keys to spank the monkey. Left arrow for left speaker, down or up arrow for centered in both speakers, or right for the right speaker. Don't take too long, monkeys don't like to wait for their spankings. Along the way there will be distracting encouragements, so listen carefully. +If ButtHead insults you, don't forget to kick him in the nads! Press space or control to kick him. +You have to be qujick though, or he'll get away. diff --git a/monkeyspank b/monkeyspank index 8d4528c..4a3073d 100755 --- a/monkeyspank +++ b/monkeyspank @@ -11,6 +11,12 @@ pygame.mixer.set_reserved(1) pygame.mixer.set_reserved(2) +def butthead_taunt(sounds): + global bonus + global points + play_random(sounds, "butt-head") + bonus = True + def monkey_taunt(): t = pygame.mixer.Channel(1) left = 1.0 @@ -40,11 +46,14 @@ def player_action(monkey, reaction): def game(mode): pygame.mixer.music.pause() + global bonus + bonusTime = int(time.time()) encourage = int(time.time()) lose = False cut_scene(sounds, 'start-game') startTime = time.time() totalTime = startTime + global points global spanks taunt = monkey_taunt() timeOut = time.time() @@ -86,10 +95,21 @@ def game(mode): if lose == True: continue taunt = monkey_taunt() timeOut = time.time() + elif (event.key in [pygame.K_SPACE, pygame.K_LCTRL, pygame.K_RCTRL]) 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: + bonus = False + bonusTime = time.time() totalTime = time.time() if int(time.time()) - encourage == 8: - play_random(sounds, "encourage") + if random.randrange(0, 5) < 2: + play_random(sounds, "encourage") + else: + butthead_taunt(sounds) encourage = int(time.time()) pygame.event.pump() time.sleep(0.001) @@ -113,6 +133,7 @@ def game(mode): # Game starts at main menu mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game") while mode != "exit_game": + bonus = False spanks = 0 points = 0 if mode == "menu": mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game")