2024-03-11 21:24:16 +01:00
|
|
|
CUBE_SIZE = 64
|
2024-04-14 21:39:04 +02:00
|
|
|
NUM_X = 6
|
2024-04-13 23:55:58 +02:00
|
|
|
NUM_Y = 3
|
2024-03-11 21:24:16 +01:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
2024-04-13 01:51:52 +02:00
|
|
|
def getGameWidth():
|
|
|
|
return NUM_X * CUBE_SIZE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-11 21:24:16 +01:00
|
|
|
def getScreenHeihgt():
|
2024-04-13 01:39:39 +02:00
|
|
|
return NUM_Y * CUBE_SIZE
|
|
|
|
|
|
|
|
|
2024-04-13 01:51:52 +02:00
|
|
|
def getScreenWidth(show_console):
|
|
|
|
screen_width=getGameWidth()
|
|
|
|
if(show_console):
|
|
|
|
screen_width=screen_width+350
|
|
|
|
return screen_width
|
2024-04-13 01:39:39 +02:00
|
|
|
|
|
|
|
def getConsoleWidth():
|
|
|
|
return 350
|
|
|
|
|
|
|
|
def getConsoleWidthCenter():
|
|
|
|
return getScreenWidth()+getConsoleWidth()/2
|