diff --git a/.gitignore b/.gitignore
index b537ddb..894a44c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,104 @@
-brutalmaze.egg-info
-build
-dist
-__pycache__
-*.pyc
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+.hypothesis/
+.pytest_cache/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# pyenv
+.python-version
+
+# celery beat schedule file
+celerybeat-schedule
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
diff --git a/brutalmaze/characters.py b/brutalmaze/characters.py
index 7e9312e..7fa8c93 100644
--- a/brutalmaze/characters.py
+++ b/brutalmaze/characters.py
@@ -19,15 +19,15 @@
__doc__ = 'Brutal Maze module for hero and enemy classes'
from collections import deque
-from math import atan2, gcd, sin, pi
+from math import atan2, gcd, pi, sin
from random import choice, randrange, shuffle
from sys import modules
-from .constants import (
- TANGO, HERO_HP, SFX_HEART, HEAL_SPEED, MIN_BEAT, ATTACK_SPEED, ENEMY,
- ENEMY_SPEED, ENEMY_HP, SFX_SPAWN, SFX_SLASH_HERO, MIDDLE, WALL, FIRANGE,
- AROUND_HERO, ADJACENTS, EMPTY, SQRT2, ENEMIES)
-from .misc import sign, randsign, regpoly, fill_aapolygon, play
+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 .misc import fill_aapolygon, play, randsign, regpoly, sign
from .weapons import Bullet
@@ -273,7 +273,7 @@ class Enemy:
if self.spin_queue and wound: self.maze.hit_hero(wound, self.color)
return wound
- def get_angle(self, reversed=False):
+ def get_angle(self):
"""Return the angle of the vector whose initial point is
the center of the screen and terminal point is the center of
the enemy.
@@ -347,12 +347,12 @@ class Chameleon(Enemy):
visible (float): time until the Chameleon is visible (in ms)
"""
def __init__(self, maze, x, y):
- Enemy.__init__(self, maze, x, y, 'Chameleon')
+ super().__init__(maze, x, y, 'Chameleon')
self.visible = 0.0
def wake(self):
"""Wake the Chameleon up if it can see the hero."""
- if Enemy.wake(self) is True:
+ if super().wake() is True:
self.visible = 1000 / ENEMY_SPEED
def isunnoticeable(self, x=None, y=None):
@@ -361,25 +361,25 @@ class Chameleon(Enemy):
Only search within column x and row y if these coordinates
are provided.
"""
- return (Enemy.isunnoticeable(self, x, y)
+ return (super().isunnoticeable(x, y)
or self.visible <= 0 and not self.spin_queue
and self.maze.next_move <= 0)
def update(self):
"""Update the Chameleon."""
- Enemy.update(self)
+ super().update()
if self.awake: self.visible -= 1000 / self.maze.fps
def hit(self, wound):
"""Handle the Chameleon when it's attacked."""
self.visible = 1000.0 / ENEMY_SPEED
- Enemy.hit(self, wound)
+ super().hit(wound)
class Plum(Enemy):
"""Object representing an enemy of Plum."""
def __init__(self, maze, x, y):
- Enemy.__init__(self, maze, x, y, 'Plum')
+ super().__init__(maze, x, y, 'Plum')
def clone(self, other):
"""Turn the other enemy into a clone of this Plum and return
@@ -396,18 +396,18 @@ class Plum(Enemy):
class ScarletRed(Enemy):
"""Object representing an enemy of Scarlet Red."""
def __init__(self, maze, x, y):
- Enemy.__init__(self, maze, x, y, 'ScarletRed')
+ super().__init__(maze, x, y, 'ScarletRed')
def fire(self):
"""Scarlet Red doesn't shoot."""
return False
def move(self):
- return Enemy.move(self, ENEMY_SPEED * SQRT2)
+ return super().move(self, ENEMY_SPEED * SQRT2)
def slash(self):
"""Handle the Scarlet Red's close-range attack."""
- self.wound -= Enemy.slash(self)
+ self.wound -= super().slash()
if self.wound < 0: self.wound = 0.0
diff --git a/brutalmaze/game.py b/brutalmaze/game.py
index ecf23d6..8b11228 100644
--- a/brutalmaze/game.py
+++ b/brutalmaze/game.py
@@ -16,28 +16,28 @@
# You should have received a copy of the GNU Affero General Public License
# along with Brutal Maze. If not, see