From e7011ce8f329114633f6652ed64424c6678dd63a Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 11 Dec 2019 09:49:18 -0500 Subject: [PATCH] Scoreboard partially implemented. --- libstormgames | 2 +- monkeyspank | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libstormgames b/libstormgames index f2326c6..08f0669 160000 --- a/libstormgames +++ b/libstormgames @@ -1 +1 @@ -Subproject commit f2326c628c6eddff9f60ea8c0eeca6bbb93dae0a +Subproject commit 08f06699c8d5df9034da56d536d6f5b73809ff45 diff --git a/monkeyspank b/monkeyspank index f241e16..0333438 100755 --- a/monkeyspank +++ b/monkeyspank @@ -14,7 +14,6 @@ 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() @@ -32,7 +31,6 @@ def monkey_taunt(): def player_action(monkey, reaction): if monkey != reaction: return True - global points global spanks left = 0.7 right = 0.7 @@ -41,7 +39,7 @@ def player_action(monkey, reaction): p = pygame.mixer.Channel(2) p.play(sounds['spank-hit']) p.set_volume(left, right) - points += 10 + score.Increase_Score(10) spanks += 1 return False @@ -56,7 +54,6 @@ def game(mode): cut_scene(sounds, 'start-game') startTime = time.time() totalTime = startTime - global points global spanks taunt = monkey_taunt() timeOut = time.time() @@ -100,7 +97,7 @@ def game(mode): timeOut = time.time() elif event.key == pygame.K_SPACE and bonus == True: bonus = False - points += 100 + score.Increase_Score(100) k = pygame.mixer.Channel(0) k.play(sounds['kick-hit']) pygame.event.clear() @@ -127,7 +124,7 @@ def game(mode): message.append("You averaged " + str(round(spanks / (totalTime - startTime), 2)) + " monkey spanks per second.") except: message.append("You averaged 0.00 monkey spanks per second.") - message.append("You scored " + str(points) + " points.") + message.append("You scored " + str(score.Get_Score()) + " points.") time.sleep(0.1) display_text(message) return "menu" @@ -137,8 +134,8 @@ mode = game_menu(sounds, "start game", "instructions", "donate", "credits", "lea while mode != "exit_game": bonus = False bonusTime = time.time() + score = scoreboard() spanks = 0 - points = 0 if mode == "menu": mode = game_menu(sounds, "start game", "instructions", "donate", "credits", "learn sounds", "exit_game") if mode == "start game": mode = game(mode) if mode == "learn sounds": mode = learn_sounds(sounds)