124 lines
7.5 KiB
Python
124 lines
7.5 KiB
Python
# definicje
|
|
import os
|
|
import pygame
|
|
|
|
pygame.init()
|
|
BLOCK_SIZE = 60
|
|
BEETROOT = pygame.image.load(os.path.join('resources/images', 'beetroot.png'))
|
|
BEETROOT = pygame.transform.scale(BEETROOT, (BLOCK_SIZE, BLOCK_SIZE))
|
|
BEETROOTS_ADULT_COST = None
|
|
BEETROOTS_GROW_COST = None
|
|
BEETROOTS_GROW_TIME = 5
|
|
BEETROOTS_MAXIMUM_STATE = BEETROOTS_GROW_TIME * 3 + 1
|
|
BEETROOTS_STAGE_0 = pygame.image.load(os.path.join('resources/images', 'beetroots_stage_0.png'))
|
|
BEETROOTS_STAGE_0 = pygame.transform.scale(BEETROOTS_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
|
|
BEETROOTS_STAGE_1 = pygame.image.load(os.path.join('resources/images', 'beetroots_stage_1.png'))
|
|
BEETROOTS_STAGE_1 = pygame.transform.scale(BEETROOTS_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
|
|
BEETROOTS_STAGE_2 = pygame.image.load(os.path.join('resources/images', 'beetroots_stage_2.png'))
|
|
BEETROOTS_STAGE_2 = pygame.transform.scale(BEETROOTS_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
|
|
BEETROOTS_STAGE_3 = pygame.image.load(os.path.join('resources/images', 'beetroots_stage_3.png'))
|
|
BEETROOTS_STAGE_3 = pygame.transform.scale(BEETROOTS_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CARROT = pygame.image.load(os.path.join('resources/images', 'carrot.png'))
|
|
CARROT = pygame.transform.scale(CARROT, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CARROTS_ADULT_COST = None
|
|
CARROTS_GROW_COST = None
|
|
CARROTS_GROW_TIME = 5
|
|
CARROTS_MAXIMUM_STATE = CARROTS_GROW_TIME * 3 + 1
|
|
CARROTS_STAGE_0 = pygame.image.load(os.path.join('resources/images', 'carrots_stage_0.png'))
|
|
CARROTS_STAGE_0 = pygame.transform.scale(CARROTS_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CARROTS_STAGE_1 = pygame.image.load(os.path.join('resources/images', 'carrots_stage_1.png'))
|
|
CARROTS_STAGE_1 = pygame.transform.scale(CARROTS_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CARROTS_STAGE_2 = pygame.image.load(os.path.join('resources/images', 'carrots_stage_2.png'))
|
|
CARROTS_STAGE_2 = pygame.transform.scale(CARROTS_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CARROTS_STAGE_3 = pygame.image.load(os.path.join('resources/images', 'carrots_stage_3.png'))
|
|
CARROTS_STAGE_3 = pygame.transform.scale(CARROTS_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CART_DIRECTION_EAST_TEXTURE = pygame.image.load(os.path.join('resources/images', 'minecart_command_block_east.png'))
|
|
CART_DIRECTION_EAST_TEXTURE = pygame.transform.scale(CART_DIRECTION_EAST_TEXTURE, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CART_DIRECTION_NORTH_TEXTURE = pygame.image.load(os.path.join('resources/images', 'minecart_command_block_north.png'))
|
|
CART_DIRECTION_NORTH_TEXTURE = pygame.transform.scale(CART_DIRECTION_NORTH_TEXTURE, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CART_DIRECTION_SOUTH_TEXTURE = pygame.image.load(os.path.join('resources/images', 'minecart_command_block_south.png'))
|
|
CART_DIRECTION_SOUTH_TEXTURE = pygame.transform.scale(CART_DIRECTION_SOUTH_TEXTURE, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CART_DIRECTION_WEST_TEXTURE = pygame.image.load(os.path.join('resources/images', 'minecart_command_block_west.png'))
|
|
CART_DIRECTION_WEST_TEXTURE = pygame.transform.scale(CART_DIRECTION_WEST_TEXTURE, (BLOCK_SIZE, BLOCK_SIZE))
|
|
CART_DIRECTION_EAST = 2
|
|
CART_DIRECTION_NORTH = 1
|
|
CART_DIRECTION_SOUTH = 3
|
|
CART_DIRECTION_WEST = 4
|
|
CART_FERTILIZER = 2
|
|
CART_FUEL = 200
|
|
CART_AMOUNT_OF_SEEDS_EACH_TYPE = 20
|
|
CART_MAXIMUM_COLLECTED_PLANTS = 200
|
|
CART_WATER_LEVEL = 40
|
|
DIRT = pygame.image.load(os.path.join('resources/images', 'dirt.png'))
|
|
DIRT = pygame.transform.scale(DIRT, (BLOCK_SIZE, BLOCK_SIZE))
|
|
DIRT_COST = None
|
|
FARMLAND_DRY = pygame.image.load(os.path.join('resources/images', 'farmland_dry.png'))
|
|
FARMLAND_DRY = pygame.transform.scale(FARMLAND_DRY, (BLOCK_SIZE, BLOCK_SIZE))
|
|
FARMLAND_DRY_COST = None
|
|
FARMLAND_WET = pygame.image.load(os.path.join('resources/images', 'farmland_wet.png'))
|
|
FARMLAND_WET = pygame.transform.scale(FARMLAND_WET, (BLOCK_SIZE, BLOCK_SIZE))
|
|
FARMLAND_WET_COST = None
|
|
FLOWER_DANDELION = pygame.image.load(os.path.join('resources/images', 'flower_dandelion.png'))
|
|
FLOWER_DANDELION = pygame.transform.scale(FLOWER_DANDELION, (BLOCK_SIZE, BLOCK_SIZE))
|
|
FLOWER_DANDELION_COST = None
|
|
FLOWER_DANDELION_GROW_PROBABILITY = 0.01
|
|
FLOWER_DANDELION_MAXIMUM_STATE = 1
|
|
FONT_COLOR = (255, 255, 255)
|
|
FONT_SIZE = 23
|
|
FONT = pygame.font.Font(os.path.join('resources/font', 'Minecraft.ttf'), FONT_SIZE)
|
|
FPS = 1
|
|
GENETIC_ALGORITHM_COSTS_AMOUNT = 13
|
|
GENETIC_ALGORITHM_NUMBER_OF_BEST_INDIVIDUALS = 4
|
|
GENETIC_ALGORITHM_NUMBER_OF_CART_MOVES = 1000
|
|
GENETIC_ALGORITHM_NUMBER_OF_GENERATIONS = 10
|
|
GENETIC_ALGORITHM_NUMBER_OF_INDIVIDUALS = 10
|
|
GENETIC_ALGORITHM_NUMBER_OF_INDIVIDUALS_ZERO = 10
|
|
HEIGHT_AMOUNT, WIDTH_AMOUNT = 10, 10
|
|
HEIGHT_MAP, WIDTH_MAP = BLOCK_SIZE * HEIGHT_AMOUNT, BLOCK_SIZE * WIDTH_AMOUNT
|
|
HEIGHT, WIDTH = HEIGHT_MAP + BLOCK_SIZE, WIDTH_MAP
|
|
IMAGE_SIZE_NEURAL_NETWORK = 16
|
|
POTATO = pygame.image.load(os.path.join('resources/images', 'potato.png'))
|
|
POTATO = pygame.transform.scale(POTATO, (BLOCK_SIZE, BLOCK_SIZE))
|
|
POTATOES_ADULT_COST = None
|
|
POTATOES_GROW_COST = None
|
|
POTATOES_GROW_TIME = 5
|
|
POTATOES_MAXIMUM_STATE = POTATOES_GROW_TIME * 3 + 1
|
|
POTATOES_STAGE_0 = pygame.image.load(os.path.join('resources/images', 'potatoes_stage_0.png'))
|
|
POTATOES_STAGE_0 = pygame.transform.scale(POTATOES_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
|
|
POTATOES_STAGE_1 = pygame.image.load(os.path.join('resources/images', 'potatoes_stage_1.png'))
|
|
POTATOES_STAGE_1 = pygame.transform.scale(POTATOES_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
|
|
POTATOES_STAGE_2 = pygame.image.load(os.path.join('resources/images', 'potatoes_stage_2.png'))
|
|
POTATOES_STAGE_2 = pygame.transform.scale(POTATOES_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
|
|
POTATOES_STAGE_3 = pygame.image.load(os.path.join('resources/images', 'potatoes_stage_3.png'))
|
|
POTATOES_STAGE_3 = pygame.transform.scale(POTATOES_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
|
|
SPONGE = pygame.image.load(os.path.join('resources/images', 'sponge.png'))
|
|
SPONGE = pygame.transform.scale(SPONGE, (BLOCK_SIZE, BLOCK_SIZE))
|
|
SPONGE_WET = pygame.image.load(os.path.join('resources/images', 'sponge_wet.png'))
|
|
SPONGE_WET = pygame.transform.scale(SPONGE_WET, (BLOCK_SIZE, BLOCK_SIZE))
|
|
STATION = pygame.image.load(os.path.join('resources/images', 'rail_normal.png'))
|
|
STATION = pygame.transform.scale(STATION, (BLOCK_SIZE, BLOCK_SIZE))
|
|
STATION_COST = None
|
|
WHEAT = pygame.image.load(os.path.join('resources/images', 'wheat.png'))
|
|
WHEAT = pygame.transform.scale(WHEAT, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_ADULT_COST = None
|
|
WHEAT_GROW_COST = None
|
|
WHEAT_GROW_TIME = 5
|
|
WHEAT_MAXIMUM_STATE = WHEAT_GROW_TIME * 7 + 1
|
|
WHEAT_STAGE_0 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_0.png'))
|
|
WHEAT_STAGE_0 = pygame.transform.scale(WHEAT_STAGE_0, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_1 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_1.png'))
|
|
WHEAT_STAGE_1 = pygame.transform.scale(WHEAT_STAGE_1, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_2 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_2.png'))
|
|
WHEAT_STAGE_2 = pygame.transform.scale(WHEAT_STAGE_2, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_3 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_3.png'))
|
|
WHEAT_STAGE_3 = pygame.transform.scale(WHEAT_STAGE_3, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_4 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_4.png'))
|
|
WHEAT_STAGE_4 = pygame.transform.scale(WHEAT_STAGE_4, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_5 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_5.png'))
|
|
WHEAT_STAGE_5 = pygame.transform.scale(WHEAT_STAGE_5, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_6 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_6.png'))
|
|
WHEAT_STAGE_6 = pygame.transform.scale(WHEAT_STAGE_6, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WHEAT_STAGE_7 = pygame.image.load(os.path.join('resources/images', 'wheat_stage_7.png'))
|
|
WHEAT_STAGE_7 = pygame.transform.scale(WHEAT_STAGE_7, (BLOCK_SIZE, BLOCK_SIZE))
|
|
WINDOW = pygame.display.set_mode((WIDTH, HEIGHT))
|