Inteligentny_Traktor_Grupa_16/main.py
2022-03-09 19:51:09 +01:00

49 lines
1.3 KiB
Python

import pygame
from pygame.locals import *
from world_creator import World
SCREEN_WIDTH = 1100
SCREEN_HEIGHT = 1100
def draw_line(screen: pygame.display, tile_size):
for line in range(0, 11):
pygame.draw.line(screen, (255, 255, 255), (0, line * tile_size), (SCREEN_WIDTH, line*tile_size))
pygame.draw.line(screen, (255, 255, 255), (line * tile_size, 0), (line * tile_size, SCREEN_HEIGHT))
def main():
pygame.init()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
tile_size = 110
world = World(tile_size)
pygame.display.set_caption('TRAKTOHOLIK')
background_image = pygame.image.load('assets/images/sky.png')
background_image = pygame.transform.scale(background_image, (SCREEN_WIDTH, SCREEN_HEIGHT))
tractor_image = pygame.transform.scale(pygame.image.load('assets/images/tractor.png'), (0.9*tile_size, 0.9*tile_size))
run = True
while run:
screen.blit(background_image, (0, 0))
world.draw(screen)
draw_line(screen, tile_size)
screen.blit(tractor_image, (6*tile_size, 5*tile_size))
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.display.update()
pygame.quit()
if __name__ == '__main__':
main()