Added bonuses possibilities to the game.

This commit is contained in:
Storm Dragon 2019-12-08 14:11:28 -05:00
parent 2c6d8b71f4
commit a4005de0f0
2 changed files with 24 additions and 1 deletions

View File

@ -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. 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. 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. 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.

View File

@ -11,6 +11,12 @@ pygame.mixer.set_reserved(1)
pygame.mixer.set_reserved(2) pygame.mixer.set_reserved(2)
def butthead_taunt(sounds):
global bonus
global points
play_random(sounds, "butt-head")
bonus = True
def monkey_taunt(): def monkey_taunt():
t = pygame.mixer.Channel(1) t = pygame.mixer.Channel(1)
left = 1.0 left = 1.0
@ -40,11 +46,14 @@ def player_action(monkey, reaction):
def game(mode): def game(mode):
pygame.mixer.music.pause() pygame.mixer.music.pause()
global bonus
bonusTime = int(time.time())
encourage = int(time.time()) encourage = int(time.time())
lose = False lose = False
cut_scene(sounds, 'start-game') cut_scene(sounds, 'start-game')
startTime = time.time() startTime = time.time()
totalTime = startTime totalTime = startTime
global points
global spanks global spanks
taunt = monkey_taunt() taunt = monkey_taunt()
timeOut = time.time() timeOut = time.time()
@ -86,10 +95,21 @@ def game(mode):
if lose == True: continue if lose == True: continue
taunt = monkey_taunt() taunt = monkey_taunt()
timeOut = time.time() 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() pygame.event.clear()
if bonusTime - time.time() > 0.75:
bonus = False
bonusTime = time.time()
totalTime = time.time() totalTime = time.time()
if int(time.time()) - encourage == 8: if int(time.time()) - encourage == 8:
if random.randrange(0, 5) < 2:
play_random(sounds, "encourage") play_random(sounds, "encourage")
else:
butthead_taunt(sounds)
encourage = int(time.time()) encourage = int(time.time())
pygame.event.pump() pygame.event.pump()
time.sleep(0.001) time.sleep(0.001)
@ -113,6 +133,7 @@ def game(mode):
# Game starts at main menu # Game starts at main menu
mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game") mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game")
while mode != "exit_game": while mode != "exit_game":
bonus = False
spanks = 0 spanks = 0
points = 0 points = 0
if mode == "menu": mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game") if mode == "menu": mode = game_menu("start game", "instructions", "donate", "credits", "learn sounds", "exit_game")