From b83ddd7e5bf2ea9c59f6fb2d78ebddc9dc845046 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 5 Mar 2016 22:27:04 +0200 Subject: [PATCH] Load sounds on weapon init --- koperkapel/weapons.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 = [ -- 2.34.1