35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
import pygame
|
|
|
|
from Shelf import Shelf
|
|
from Grid import Grid
|
|
from num_map import num_matrix
|
|
|
|
HORIZONTAL = 1250
|
|
VERTICAL = 750
|
|
|
|
TILE_SIZE = 50
|
|
|
|
background = (49, 51, 53)
|
|
|
|
|
|
class Environment:
|
|
def __init__(self, window):
|
|
self.window = window
|
|
self.grid = Grid(self.window)
|
|
self.Shelf = Shelf(self.window)
|
|
self.image = pygame.image.load('resources/texture5.PNG').convert_alpha()
|
|
self.rock = pygame.image.load('resources/texture4.PNG').convert_alpha()
|
|
self.dirt = pygame.image.load('resources/texture3.PNG').convert_alpha()
|
|
|
|
def drawEnviroment(self):
|
|
for j in range(0, int(VERTICAL / TILE_SIZE)):
|
|
for i in range(0, int(HORIZONTAL / TILE_SIZE)):
|
|
if num_matrix[j][i] == 0:
|
|
self.window.blit(self.image, (i * TILE_SIZE, j * TILE_SIZE))
|
|
elif str(num_matrix[j][i]) in 'r':
|
|
self.window.blit(self.rock, (i * TILE_SIZE, j * TILE_SIZE))
|
|
elif str(num_matrix[j][i]) in 'd':
|
|
self.window.blit(self.dirt, (i * TILE_SIZE, j * TILE_SIZE))
|
|
self.Shelf.drawShelves()
|
|
self.grid.drawGrid()
|