v. 1.06
This commit is contained in:
parent
ba447abfb9
commit
f72df6eac1
@ -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])
|
||||
|
5
main.py
5
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)
|
||||
|
Loading…
Reference in New Issue
Block a user