22 lines
697 B
Python
22 lines
697 B
Python
import random
|
|
import pygame
|
|
import time
|
|
|
|
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)
|
|
|
|
self.IS_NIGHT = False
|
|
self.TIME_CHANGE = time.time() + 60
|
|
|
|
self.season = random.choice(["spring", "summer", "autumn", "winter"])
|
|
|
|
def init_pygame(const):
|
|
pygame.init()
|
|
const.screen = pygame.display.set_mode(const.WINDOW_SIZE) |