From: Simon Cross Date: Sat, 10 Sep 2016 22:41:15 +0000 (+0200) Subject: Add battery dying sound. X-Git-Tag: tabakrolletjie-v1.0.0~22 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=8afdc1920e2286fcd96bc3e371d515e5c649f772;p=tabakrolletjie.git Add battery dying sound. --- diff --git a/data/sounds/battery_dying.ogg b/data/sounds/battery_dying.ogg new file mode 100644 index 0000000..e7392fe Binary files /dev/null and b/data/sounds/battery_dying.ogg differ diff --git a/data/sounds/sources.txt b/data/sounds/sources.txt index 021f532..d6b8007 100644 --- a/data/sounds/sources.txt +++ b/data/sounds/sources.txt @@ -36,6 +36,19 @@ Notes: Ogg generated using 'oggenc -q -1 -o beep_kind.ogg BEEPKIND.WAV' +battery_dying.ogg +----------------- + +URL: + http://archive.org/download/Berklee44v3/Berklee44v3.zip +Source: + http://archive.org/details/Berklee44v3 +License: + http://creativecommons.org/licenses/by/3.0 +Notes: + Ogg generated using 'oggenc -q -1 -o battery_dying.ogg feedback_efx_2.wav' + + eating_chips_1.ogg eating_chips_2.ogg eating_chips_3.ogg diff --git a/tabakrolletjie/scenes/night.py b/tabakrolletjie/scenes/night.py index 7813e32..593a03f 100644 --- a/tabakrolletjie/scenes/night.py +++ b/tabakrolletjie/scenes/night.py @@ -14,6 +14,7 @@ from ..enemies import Boyd from ..events import SceneChangeEvent from ..utils import debug_timer, shadowed_text from ..loader import loader +from ..sound import sound from ..transforms import Overlay from ..turnip import Turnip from ..widgets import ImageButton @@ -31,6 +32,7 @@ class NightScene(BaseScene): self._obstacles = ObstacleManager(self._space, gamestate) self._lights = LightManager(self._space, gamestate) self._battery = BatteryManager(gamestate) + self._battery_dead = False self.check_battery() self._infobar = InfoBar("day", battery=self._battery, scene=self) self._countdownbar = CountDownBar("h") @@ -175,7 +177,9 @@ class NightScene(BaseScene): (350, 240))) def check_battery(self): - if self._battery.current == 0: + if self._battery.current == 0 and not self._battery_dead: + self._battery_dead = True + sound.play_sound("battery_dying.ogg") self._lights.battery_dead() @debug_timer("night.tick")