minor main and constants refactors

This commit is contained in:
s452645 2021-03-12 09:55:59 +01:00
parent cb61ee5147
commit bf0760588c
2 changed files with 19 additions and 14 deletions

View File

@ -8,7 +8,7 @@ import event_interpreter
if __name__ == "__main__": def main():
pygame.init() pygame.init()
@ -62,3 +62,6 @@ if __name__ == "__main__":
running = False running = False
else: event_interpreter.interpret( event ) else: event_interpreter.interpret( event )
if __name__ == "__main__":
main()

View File

@ -17,6 +17,8 @@ V_NAME_OF_WINDOW = "MineFusion TM"
V_TILE_SIZE = 60 V_TILE_SIZE = 60
V_GRID_VER_TILES = V_GRID_HOR_TILES = 10 # vertical, horizontal V_GRID_VER_TILES = V_GRID_HOR_TILES = 10 # vertical, horizontal
V_SCREEN_PADDING = 10 V_SCREEN_PADDING = 10
V_MINEFIELD_HEIGHT = V_TILE_SIZE * V_GRID_VER_TILES
V_MINEFIELD_WIDTH = V_TILE_SIZE * V_GRID_HOR_TILES
SCREEN = pygame.display.set_mode\ SCREEN = pygame.display.set_mode\
( (
@ -35,77 +37,77 @@ SCREEN = pygame.display.set_mode\
ASSET_BACKGROUND = pygame.transform.scale\ ASSET_BACKGROUND = pygame.transform.scale\
( (
pygame.image.load('resources/assets/new_grid.png'), pygame.image.load('resources/assets/new_grid.png'),
( 600, 600 ) (V_MINEFIELD_WIDTH, V_MINEFIELD_WIDTH)
) )
ASSET_SAPPER = pygame.transform.scale\ ASSET_SAPPER = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/sapper.png' ), pygame.image.load( 'resources/assets/sapper.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_MINE_A = pygame.transform.scale\ ASSET_MINE_A = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/mine_a.png' ), pygame.image.load( 'resources/assets/mine_a.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_MINE_B = pygame.transform.scale\ ASSET_MINE_B = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/mine_b.png' ), pygame.image.load( 'resources/assets/mine_b.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_MINE_F = pygame.transform.scale\ ASSET_MINE_F = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/mine_f.png' ), pygame.image.load( 'resources/assets/mine_f.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_MINE_K = pygame.transform.scale\ ASSET_MINE_K = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/mine_k.png' ), pygame.image.load( 'resources/assets/mine_k.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_ORANGE = pygame.transform.scale\ ASSET_TILE_ORANGE = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_orange.png' ), pygame.image.load( 'resources/assets/tile_orange.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_RED = pygame.transform.scale\ ASSET_TILE_RED = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_red.png' ), pygame.image.load( 'resources/assets/tile_red.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_BLUE = pygame.transform.scale\ ASSET_TILE_BLUE = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_blue.png' ), pygame.image.load( 'resources/assets/tile_blue.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_PURPLE = pygame.transform.scale\ ASSET_TILE_PURPLE = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_purple.png' ), pygame.image.load( 'resources/assets/tile_purple.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_GREEN = pygame.transform.scale\ ASSET_TILE_GREEN = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_green.png' ), pygame.image.load( 'resources/assets/tile_green.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_YELLOW = pygame.transform.scale\ ASSET_TILE_YELLOW = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_yellow.png' ), pygame.image.load( 'resources/assets/tile_yellow.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )
ASSET_TILE_WHITE = pygame.transform.scale\ ASSET_TILE_WHITE = pygame.transform.scale\
( (
pygame.image.load( 'resources/assets/tile_white.png' ), pygame.image.load( 'resources/assets/tile_white.png' ),
( 60, 60 ) (V_TILE_SIZE, V_TILE_SIZE)
) )