Added bonuses possibilities to the game.
This commit is contained in:
parent
2c6d8b71f4
commit
a4005de0f0
@ -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.
|
||||
|
23
monkeyspank
23
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")
|
||||
|
Loading…
Reference in New Issue
Block a user