From e418fc3b9bfe599d91d282ac8aadd1767b889bec Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Sat, 3 Sep 2022 14:12:00 +0200 Subject: [PATCH] some sounds --- Sound.py | 2 +- events/SpinnerEvent.py | 8 ++++---- targets/pop_bumpers/LeftPopTarget.py | 3 ++- targets/pop_bumpers/RightPopTarget.py | 3 ++- targets/specials/SpecialOrangeTarget.py | 3 ++- targets/specials/SpecialRedTarget.py | 3 ++- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Sound.py b/Sound.py index b5e394d..ea60ac4 100644 --- a/Sound.py +++ b/Sound.py @@ -5,5 +5,5 @@ class Sound: self.name = "Sound " + str(id) pass - def play(self, name): + def play(self): networking.playSound(self.name) \ No newline at end of file diff --git a/events/SpinnerEvent.py b/events/SpinnerEvent.py index 915e5ba..4b79da5 100644 --- a/events/SpinnerEvent.py +++ b/events/SpinnerEvent.py @@ -19,11 +19,11 @@ class SpinnerEvent(Event): def scorePoints(self): playerState = self.gameState.currentPlayer timePassed = time() - self.activationTime - if 1 <= timePassed < 1.5: + if 0.5 <= timePassed < 1: playerState.addPoints(100000) - elif 1.5 <= timePassed < 2: + elif 1 <= timePassed < 1.5: playerState.addPoints(150000) - elif 2 <= timePassed < 5: + elif 1.5 <= timePassed < 3: playerState.addPoints(200000) - elif timePassed >= 5: + elif timePassed >= 3: playerState.addPoints(500000) diff --git a/targets/pop_bumpers/LeftPopTarget.py b/targets/pop_bumpers/LeftPopTarget.py index 9226893..020cf16 100644 --- a/targets/pop_bumpers/LeftPopTarget.py +++ b/targets/pop_bumpers/LeftPopTarget.py @@ -1,9 +1,10 @@ from Target import Target - +from Sound import Sound class LeftPopTarget(Target): def __init__(self): super().__init__(5000, "Left Pop") def hit(self): + Sound(3).play() super().hit() \ No newline at end of file diff --git a/targets/pop_bumpers/RightPopTarget.py b/targets/pop_bumpers/RightPopTarget.py index f49c1ff..49e6774 100644 --- a/targets/pop_bumpers/RightPopTarget.py +++ b/targets/pop_bumpers/RightPopTarget.py @@ -1,9 +1,10 @@ from Target import Target - +from Sound import Sound class RightPopTarget(Target): def __init__(self): super().__init__(5000, 'Right Pop') def hit(self): + Sound(3).play() super().hit() \ No newline at end of file diff --git a/targets/specials/SpecialOrangeTarget.py b/targets/specials/SpecialOrangeTarget.py index 38ff2cf..89d2826 100644 --- a/targets/specials/SpecialOrangeTarget.py +++ b/targets/specials/SpecialOrangeTarget.py @@ -1,5 +1,5 @@ from Target import Target - +from Sound import Sound # A standup target. When lit, it scores the Orange Special (operator # adjustable) for Nothing, Extra Ball, Replay, Super Bonus, or 300,000 @@ -9,4 +9,5 @@ class FixedSpecialOrangeTarget(Target): super().__init__(100000, "Special Orange") def hit(self): + Sound(5).play() super().hit() \ No newline at end of file diff --git a/targets/specials/SpecialRedTarget.py b/targets/specials/SpecialRedTarget.py index b047f7b..32f9c2a 100644 --- a/targets/specials/SpecialRedTarget.py +++ b/targets/specials/SpecialRedTarget.py @@ -1,5 +1,5 @@ from Target import Target - +from Sound import Sound # A standup target. When lit, it scores the Red Special (operator # adjustable) for Nothing, Extra Ball, Replay, Super Bonus, or 1,000,000 # points. Scores 10,000 points when not lit. @@ -8,4 +8,5 @@ class FixedSpecialRedTarget(Target): super().__init__(10000, "Special Red") def hit(self): + Sound(4).play() super().hit() \ No newline at end of file