From f72df6eac147362979d8d0301338e2d5d6f2dedb Mon Sep 17 00:00:00 2001 From: v7eZ3t Date: Sun, 28 Mar 2021 22:51:41 +0200 Subject: [PATCH] v. 1.06 --- drawUI.py | 5 ++++- main.py | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drawUI.py b/drawUI.py index eaf23bb..29cf0c3 100644 --- a/drawUI.py +++ b/drawUI.py @@ -1,6 +1,9 @@ from Main.constants import * import pygame +def drawUI(board, display, tractor_horizontal_index, tractor_vertical_index): + makeField(board, display) + drawTractor(display, tractor_horizontal_index, tractor_vertical_index) def makeField(board, display): color = BLACK @@ -22,7 +25,7 @@ def makeField(board, display): [i * TILE_SIZE, j * TILE_SIZE, TILE_SIZE, TILE_SIZE]) -def drawTractor(board, display, tractor_horizontal_index, tractor_vertical_index): +def drawTractor(display, tractor_horizontal_index, tractor_vertical_index): pygame.draw.rect(display, BLACK, [tractor_horizontal_index * TILE_SIZE, tractor_vertical_index * TILE_SIZE, TRACTOR_WIDTH, TRACTOR_HEIGHT]) diff --git a/main.py b/main.py index e9b4592..e628551 100644 --- a/main.py +++ b/main.py @@ -28,7 +28,6 @@ tractor_vertical_index = 0 while working: for event in pygame.event.get(): - if event.type == pygame.QUIT: working = False if event.type == pygame.KEYDOWN: @@ -42,9 +41,7 @@ while working: tractor_vertical_index += vertical_change display.fill(WHITE) - drawUI.makeField(board, display) - - drawUI.drawTractor(board, display, tractor_horizontal_index, tractor_vertical_index) + drawUI.drawUI(board, display, tractor_horizontal_index, tractor_vertical_index) pygame.display.update() clock.tick(FPS)