from .actors.animsurf import AnimatedSurfActor
from .util import safepath
class Weapon:
def __init__(self, name, damage, image_name=None, bullet_range=0,
from .actors.animsurf import AnimatedSurfActor
from .util import safepath
class Weapon:
def __init__(self, name, damage, image_name=None, bullet_range=0,
WEAPONS = [
Weapon("spit", damage=1, bullet_range=2, can_tape=False,
WEAPONS = [
Weapon("spit", damage=1, bullet_range=2, can_tape=False,
- image_name="blank", frames=("",)),
+ image_name="blank", frames=("",), sound="fire_spit"),
Weapon("butter_knife", damage=2),
Weapon("crowbar", damage=4),
Weapon("butter_knife", damage=2),
Weapon("crowbar", damage=4),
- Weapon("gun", damage=4, bullet_range=4),
+ Weapon("gun", damage=4, bullet_range=4, sound='gun_fire'),
class WeaponActor(AnimatedSurfActor):
def __init__(self, weapon, **kw):
super().__init__(**kw)
class WeaponActor(AnimatedSurfActor):
def __init__(self, weapon, **kw):
super().__init__(**kw)
def assemble_frame(self, suffix, weapon, tape):
surf = images.load(safepath("weapons/%s%s")
def assemble_frame(self, suffix, weapon, tape):
surf = images.load(safepath("weapons/%s%s")
tape = tape and weapon.can_tape
frames = [
self.assemble_frame(suffix, weapon, tape)
tape = tape and weapon.can_tape
frames = [
self.assemble_frame(suffix, weapon, tape)