From: Neil Date: Sat, 5 Mar 2016 20:27:04 +0000 (+0200) Subject: Load sounds on weapon init X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=b83ddd7e5bf2ea9c59f6fb2d78ebddc9dc845046;p=koperkapel.git Load sounds on weapon init --- diff --git a/koperkapel/weapons.py b/koperkapel/weapons.py index 3962ecc..d2213f6 100644 --- a/koperkapel/weapons.py +++ b/koperkapel/weapons.py @@ -1,6 +1,6 @@ """ Tools for dealing with weapons. """ -from pgzero.loaders import images +from pgzero.loaders import images, sounds from .actors.animsurf import AnimatedSurfActor from .util import safepath @@ -14,7 +14,9 @@ class Weapon: self.damage = damage self.bullet_range = bullet_range self.can_tape = can_tape - self.sound = sound + self.sound = None + if sound: + self.sound = sounds.load(sound) WEAPONS = [