AI_PROJECT/App.py

50 lines
939 B
Python

import pygame
import Colors
import Tractor
import Pole
import time
import displayControler as dCon
import Image
pygame.init()
screen = pygame.display.set_mode((dCon.getScreenWidth(), dCon.getScreenHeihgt()))
#Tractor creation
traktor=Tractor.Tractor(0,0,screen)
image_loader=Image.Image()
image_loader.load_images()
pole=Pole.Pole(screen,image_loader)
def init_demo(): #Demo purpose
pole.draw_grid()
traktor.draw_tractor()
time.sleep(2)
pole.randomize_colors()
traktor.draw_tractor()
while True:
time.sleep(0.5)
demo_move()
for event in pygame.event.get():
if event.type == pygame.QUIT:
quit()
def init(demo):
screen.fill(Colors.WHITE)
pygame.display.update()
if(demo==True):
init_demo()
#TODO: Implement
def demo_move():
pole.get_slot_from_cord((traktor.x_axis,traktor.y_axis)).redraw_image()
traktor.random_move()