From 8e6faa6d267afd96de1b5996712888c5ede497aa Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 22 May 2018 20:44:22 +0700 Subject: Fix Python 3 incompatibility --- brutalmaze/constants.py | 1 + brutalmaze/game.py | 2 +- brutalmaze/maze.py | 4 ++-- setup.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/brutalmaze/constants.py b/brutalmaze/constants.py index 29b0241..e2c8e43 100644 --- a/brutalmaze/constants.py +++ b/brutalmaze/constants.py @@ -69,6 +69,7 @@ TANGO = {'Butter': ((252, 233, 79), (237, 212, 0), (196, 160, 0)), 'ScarletRed': ((239, 41, 41), (204, 0, 0), (164, 0, 0)), 'Aluminium': ((238, 238, 236), (211, 215, 207), (186, 189, 182), (136, 138, 133), (85, 87, 83), (46, 52, 54))} +TANGO_VALUES = list(TANGO.values()) ENEMIES = ['Butter', 'Orange', 'Chocolate', 'Chameleon', 'SkyBlue', 'Plum', 'ScarletRed'] COLOR_CODE = ascii_lowercase + '0' diff --git a/brutalmaze/game.py b/brutalmaze/game.py index de70881..74d6225 100644 --- a/brutalmaze/game.py +++ b/brutalmaze/game.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Brutal Maze. If not, see . -__version__ = '0.7.1' +__version__ = '0.7.3' import re from argparse import ArgumentParser, FileType, RawTextHelpFormatter diff --git a/brutalmaze/maze.py b/brutalmaze/maze.py index 43bc4b0..d733716 100644 --- a/brutalmaze/maze.py +++ b/brutalmaze/maze.py @@ -29,7 +29,7 @@ from .characters import Hero, new_enemy from .constants import ( EMPTY, WALL, HERO, ENEMY, ROAD_WIDTH, MAZE_SIZE, MIDDLE, INIT_SCORE, ENEMIES, MINW, MAXW, SQRT2, SFX_SPAWN, SFX_SLASH_ENEMY, SFX_LOSE, - ADJACENTS, TANGO, BG_COLOR, FG_COLOR, CELL_WIDTH, LAST_ROW, + ADJACENTS, TANGO_VALUES, BG_COLOR, FG_COLOR, CELL_WIDTH, LAST_ROW, HERO_HP, ENEMY_HP, ATTACK_SPEED, HERO_SPEED, BULLET_LIFETIME) from .misc import round2, sign, around, regpoly, fill_aapolygon, play from .weapons import Bullet @@ -148,7 +148,7 @@ class Maze: def get_color(self): """Return color of a grid.""" - return choice(TANGO.values())[0] if self.glitch > 0 else FG_COLOR + return choice(TANGO_VALUES)[0] if self.glitch > 0 else FG_COLOR def draw(self): """Draw the maze.""" diff --git a/setup.py b/setup.py index fe0128c..6355eea 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open('README.rst') as f: setup( name='brutalmaze', - version='0.7.1', + version='0.7.3', description='A minimalist TPS game with fast-paced action', long_description=long_description, url='https://github.com/McSinyx/brutalmaze', -- cgit 1.4.1