about summary refs log tree commit diff homepage
path: root/brutalmaze/maze.py
diff options
context:
space:
mode:
Diffstat (limited to 'brutalmaze/maze.py')
-rw-r--r--brutalmaze/maze.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/brutalmaze/maze.py b/brutalmaze/maze.py
index d64e77f..a31fb86 100644
--- a/brutalmaze/maze.py
+++ b/brutalmaze/maze.py
@@ -1,5 +1,5 @@
-# maze.py - module for the maze class
-# Copyright (C) 2017-2020  Nguyễn Gia Phong
+# Maze class
+# Copyright (C) 2017-2021  Nguyễn Gia Phong
 #
 # This file is part of Brutal Maze.
 #
@@ -31,9 +31,8 @@ from .constants import (ADJACENTS, ATTACK_SPEED, BG_COLOR,
                         BULLET_LIFETIME, CELL_NODES, CELL_WIDTH, COLORS,
                         EMPTY, ENEMIES, ENEMY, ENEMY_HP, FG_COLOR, HERO,
                         HERO_HP, HERO_SPEED, INIT_SCORE, JSON_SEPARATORS,
-                        MAX_WOUND, MAZE_SIZE, MIDDLE, ROAD_WIDTH,
-                        SFX_LOSE, SFX_MISSED, SFX_SLASH_ENEMY, SFX_SPAWN,
-                        SQRT2, TANGO_VALUES, WALL, WALL_WIDTH)
+                        MAX_WOUND, MAZE_SIZE, MIDDLE, ROAD_WIDTH, SQRT2,
+                        TANGO_VALUES, WALL, WALL_WIDTH)
 from .misc import around, deg, fill_aapolygon, json_rec, play, regpoly, sign
 from .weapons import LockOn
 
@@ -97,10 +96,6 @@ class Maze:
         self.next_move = self.glitch = self.next_slashfx = 0.0
         self.slashd = self.hero.R + self.distance/SQRT2
 
-        self.sfx_spawn = SFX_SPAWN
-        self.sfx_slash = SFX_SLASH_ENEMY
-        self.sfx_lose = SFX_LOSE
-
     def new_cell(self, x, y):
         """Draw on the map a newly created cell
         whose coordinates are given.
@@ -291,7 +286,7 @@ class Maze:
             if d > 0:
                 wound = d * SQRT2 / self.distance
                 if self.next_slashfx <= 0:
-                    play(SFX_SLASH_ENEMY, enemy.x, enemy.y, wound)
+                    play('slash-enemy.ogg', enemy.x, enemy.y, wound)
                     self.next_slashfx = ATTACK_SPEED
                 enemy.hit(wound / self.hero.spin_speed)
                 if enemy.wound >= ENEMY_HP:
@@ -321,7 +316,7 @@ class Maze:
                     enemy = new_enemy(self, gridx, gridy)
                     enemy.awake = True
                     self.map[gridx][gridy] = ENEMY
-                    play(SFX_SPAWN, enemy.x, enemy.y)
+                    play('spawn.ogg', enemy.x, enemy.y)
                     enemy.hit(wound)
                     self.enemies.append(enemy)
                     continue
@@ -339,7 +334,7 @@ class Maze:
                 if block:
                     self.hero.next_strike = (abs(self.hero.spin_queue/self.fps)
                                              + ATTACK_SPEED)
-                    play(SFX_MISSED, gain=wound)
+                    play('missed.ogg', gain=wound)
                 else:
                     self.hit_hero(wound, bullet.color)
                     play(bullet.sfx_hit, gain=wound)
@@ -507,7 +502,7 @@ class Maze:
         self.destx = self.desty = MIDDLE
         self.stepx = self.stepy = 0
         self.vx = self.vy = 0.0
-        play(SFX_LOSE)
+        play('lose.ogg')
         self.dump_records()
 
     def reinit(self):