40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
import pygame
|
|
import time
|
|
import random
|
|
|
|
from area.constants import WIDTH, HEIGHT
|
|
from area.field import drawWindow
|
|
from area.tractor import Tractor
|
|
from area.field import tiles
|
|
from ground import Dirt
|
|
from plant import Plant
|
|
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
|
|
pygame.display.set_caption('Intelligent tractor')
|
|
|
|
|
|
def main():
|
|
run = True
|
|
window = drawWindow(WIN)
|
|
pygame.display.update()
|
|
while run:
|
|
for event in pygame.event.get():
|
|
if event.type == pygame.QUIT:
|
|
run = False
|
|
|
|
#small test:
|
|
time.sleep(2)
|
|
tile1 = tiles[0]
|
|
p1 = Plant('wheat', 'cereal', random.randint(1,100), random.randint(1,100), random.randint(1,100))
|
|
d1 = Dirt(random.randint(1, 100), random.randint(1,100))
|
|
d1.pests_and_weeds()
|
|
tile1.ground=d1
|
|
t1 = Tractor(10, 10)
|
|
t1.work_on_field(tile1, d1, p1)
|
|
time.sleep(3)
|
|
print("\n")
|
|
|
|
|
|
# in loop move tractor
|
|
|
|
main()
|