Projekt_Sztuczna_Inteligencja/project_constants.py

111 lines
2.9 KiB
Python
Raw Normal View History

import pygame
2021-03-12 11:45:27 +01:00
import os
# VARIABLE STARTS WITH ... IF IT'S
# V a value like a string or an int
# STRUCT a list or other structure of values
# ASSET a png file (or other graphic format)
# MAP a JSON map file
2021-03-11 18:51:43 +01:00
# ================= #
# === VARIABLES === #
# ================= #
V_NAME_OF_WINDOW = "MineFusion TM"
2021-03-12 11:45:27 +01:00
ASSETS_DIR = os.path.join("resources", "assets")
V_TILE_SIZE = 60
V_GRID_VER_TILES = V_GRID_HOR_TILES = 10 # vertical, horizontal
V_SCREEN_PADDING = 10
2021-03-12 09:55:59 +01:00
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(
(
V_TILE_SIZE * V_GRID_HOR_TILES + 2 * V_SCREEN_PADDING, # screen width
V_TILE_SIZE * V_GRID_HOR_TILES + 2 * V_SCREEN_PADDING # screen height
)
)
# =============== #
# === STRUCTS === #
# =============== #
STRUCT_TILE_COLORS = ["BLUE", "GREEN", "ORANGE", "PURPLE", "RED", "WHITE", "YELLOW"]
STRUCT_MINE_TYPES = ['A', 'B', 'F', 'K']
# ============== #
# ==== MAPS ==== #
# ============== #
MAP_RANDOM_10x10 = os.path.join("resources", "minefields", "firstmap.json")
2021-03-11 18:51:43 +01:00
# ============== #
# === ASSETS === #
# ============== #
ASSET_BACKGROUND = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "new_grid.png")),
2021-03-12 09:55:59 +01:00
(V_MINEFIELD_WIDTH, V_MINEFIELD_WIDTH)
2021-03-11 18:51:43 +01:00
)
ASSET_SAPPER = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "sapper.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_MINE_A = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "mine_a.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_MINE_B = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "mine_b.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_MINE_F = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "mine_f.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_MINE_K = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "mine_k.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_ORANGE = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_orange.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_RED = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_red.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_BLUE = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_blue.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_PURPLE = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_purple.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_GREEN = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_green.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_YELLOW = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_yellow.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
2021-03-11 18:51:43 +01:00
)
ASSET_TILE_WHITE = pygame.transform.scale(
2021-03-12 11:45:27 +01:00
pygame.image.load(os.path.join(ASSETS_DIR, "tile_white.png")),
2021-03-12 09:55:59 +01:00
(V_TILE_SIZE, V_TILE_SIZE)
)