AI_PROJECT/displayControler.py

37 lines
670 B
Python
Raw Normal View History

CUBE_SIZE = 64
NUM_X = 6
NUM_Y = 3
#returns true if tractor can move to specified slot
def isValidMove(x, y):
if x < 0 or y < 0:
return False
if x > NUM_X - 1 or y > NUM_Y - 1:
return False
return True
def getGameWidth():
return NUM_X * CUBE_SIZE
def returnConsoleCoordinate():
return NUM_X * CUBE_SIZE
def getScreenHeihgt():
return NUM_Y * CUBE_SIZE
def getScreenWidth(show_console):
screen_width=getGameWidth()
if(show_console):
screen_width=screen_width+350
return screen_width
def getConsoleWidth():
return 350
def getConsoleWidthCenter():
return getScreenWidth()+getConsoleWidth()/2