2024-05-10 22:29:08 +02:00
|
|
|
import random
|
2024-05-08 11:54:49 +02:00
|
|
|
import pygame
|
2024-05-10 22:29:08 +02:00
|
|
|
import time
|
2024-05-08 11:54:49 +02:00
|
|
|
|
|
|
|
class Constants:
|
|
|
|
def __init__(self):
|
|
|
|
self.BLACK = (0, 0, 0)
|
|
|
|
self.RED = (255, 0, 0)
|
|
|
|
self.GRID_SIZE = 50
|
|
|
|
self.GRID_WIDTH = 30
|
|
|
|
self.GRID_HEIGHT = 15
|
|
|
|
self.WINDOW_SIZE = (self.GRID_WIDTH * self.GRID_SIZE, self.GRID_HEIGHT * self.GRID_SIZE)
|
|
|
|
self.background_image = pygame.transform.scale(pygame.image.load('images/tło.jpg'), self.WINDOW_SIZE)
|
|
|
|
|
2024-05-10 22:29:08 +02:00
|
|
|
self.IS_NIGHT = False
|
|
|
|
self.TIME_CHANGE = time.time() + 60
|
|
|
|
|
|
|
|
self.season = random.choice(["spring", "summer", "autumn", "winter"])
|
|
|
|
|
2024-05-08 11:54:49 +02:00
|
|
|
def init_pygame(const):
|
|
|
|
pygame.init()
|
|
|
|
const.screen = pygame.display.set_mode(const.WINDOW_SIZE)
|