diff --git a/constants.py b/constants.py new file mode 100644 index 0000000..48b2d63 --- /dev/null +++ b/constants.py @@ -0,0 +1,9 @@ +GAME_TITLE = 'WMICraft' +WINDOW_HEIGHT = 900 +WINDOW_WIDTH = 900 +GRID_CELL_PADDING = 3 +GRID_CELL_WIDTH = 42 +GRID_CELL_HEIGHT = 42 +ROWS = 20 +COLUMNS = 20 +FPS_COUNT = 60 diff --git a/game.py b/game.py index 54ae33e..3d8b24f 100644 --- a/game.py +++ b/game.py @@ -2,17 +2,7 @@ import pygame from glob import glob from grid import Grid - -GAME_TITLE = 'WMICraft' -WINDOW_HEIGHT = 900 -WINDOW_WIDTH = 900 -GRID_CELL_PADDING = 3 -GRID_CELL_WIDTH = 42 -GRID_CELL_HEIGHT = 42 -ROWS = 20 -COLUMNS = 20 -FPS_COUNT = 60 -GREEN = (0, 255, 0) +from constants import GAME_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT, FPS_COUNT class Game: diff --git a/grid.py b/grid.py index 285bd22..3359ff0 100644 --- a/grid.py +++ b/grid.py @@ -2,11 +2,7 @@ import pygame import random from field import Field -GRID_CELL_PADDING = 3 -GRID_CELL_WIDTH = 42 -GRID_CELL_HEIGHT = 42 -ROWS = 20 -COLUMNS = 20 +from constants import ROWS, COLUMNS, GRID_CELL_PADDING, GRID_CELL_WIDTH, GRID_CELL_HEIGHT class Grid: