about summary refs log tree commit diff homepage
path: root/brutalmaze/characters.py
diff options
context:
space:
mode:
Diffstat (limited to 'brutalmaze/characters.py')
-rw-r--r--brutalmaze/characters.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/brutalmaze/characters.py b/brutalmaze/characters.py
index 1c37be9..12eebb5 100644
--- a/brutalmaze/characters.py
+++ b/brutalmaze/characters.py
@@ -1,5 +1,5 @@
-# characters.py - module for hero and enemy classes
-# Copyright (C) 2017-2020  Nguyễn Gia Phong
+# Hero and enemy classes
+# Copyright (C) 2017-2021  Nguyễn Gia Phong
 #
 # This file is part of Brutal Maze.
 #
@@ -23,10 +23,9 @@ from math import atan2, gcd, pi, sin
 from random import choice, randrange, shuffle
 from sys import modules
 
-from .constants import (ADJACENTS, AROUND_HERO, ATTACK_SPEED, EMPTY,
-                        ENEMIES, ENEMY, ENEMY_HP, ENEMY_SPEED, FIRANGE,
-                        HEAL_SPEED, HERO_HP, MIDDLE, MIN_BEAT, SFX_HEART,
-                        SFX_SLASH_HERO, SFX_SPAWN, SQRT2, TANGO, WALL)
+from .constants import (ADJACENTS, AROUND_HERO, ATTACK_SPEED, EMPTY, ENEMIES,
+                        ENEMY, ENEMY_HP, ENEMY_SPEED, FIRANGE, HEAL_SPEED,
+                        HERO_HP, MIDDLE, MIN_BEAT, SQRT2, TANGO, WALL)
 from .misc import fill_aapolygon, play, randsign, regpoly, sign
 from .weapons import Bullet
 
@@ -84,7 +83,7 @@ class Hero:
             if self.wound < 0: self.wound = 0.0
         self.wounds.append(0.0)
         if self.next_beat <= 0:
-            play(SFX_HEART)
+            play('heart.ogg')
             self.next_beat = MIN_BEAT*(2 - self.wound/HERO_HP)
         else:
             self.next_beat -= 1000 / fps
@@ -221,7 +220,7 @@ class Enemy:
             if self.maze.map[srcx+i//w][srcy+i//u] == WALL: return False
         self.awake = True
         self.maze.map[self.x][self.y] = ENEMY
-        play(SFX_SPAWN, self.x, self.y)
+        play('spawn.ogg', self.x, self.y)
         return True
 
     def fire(self):
@@ -311,7 +310,7 @@ class Enemy:
             if not self.spin_queue and not self.fire() and not self.move():
                 self.spin_queue = randsign() * self.spin_speed
                 if not self.maze.hero.dead:
-                    play(SFX_SLASH_HERO, self.x, self.y, self.get_slash())
+                    play('slash-hero.ogg', self.x, self.y, self.get_slash())
             if round(self.spin_queue) != 0:
                 self.angle += sign(self.spin_queue) * pi / 2 / self.spin_speed
                 self.spin_queue -= sign(self.spin_queue)