Male_zoo_Projekt_SI/draw.py

22 lines
919 B
Python
Raw Normal View History

import pygame
def draw_goal(const, goal):
x, y = goal
rect = (x * const.GRID_SIZE, y * const.GRID_SIZE, const.GRID_SIZE, const.GRID_SIZE)
pygame.draw.rect(const.screen, const.RED, rect)
pygame.display.flip()
pygame.time.delay(2000)
def draw_grid(const):
for y in range(0, const.GRID_HEIGHT * const.GRID_SIZE, const.GRID_SIZE):
for x in range(0, const.GRID_WIDTH * const.GRID_SIZE, const.GRID_SIZE):
rect = pygame.Rect(x, y, const.GRID_SIZE, const.GRID_SIZE)
2024-05-08 21:18:55 +02:00
pygame.draw.rect(const.screen, const.BLACK, rect, 1)
def draw_house(const):
X = 2
Y = 0
image_path = 'images/house.png'
image_surface = pygame.image.load(image_path) # Wczytanie obrazka do obiektu Surface
scaled_image = pygame.transform.scale(image_surface, (const.GRID_SIZE * 2, const.GRID_SIZE * 2))
const.screen.blit(scaled_image, (X * const.GRID_SIZE, Y * const.GRID_SIZE))