Mateusz Czajka
ae462e2920
Renamed from bfs2 to bfs3. Added koszt to Stan and it's set automatically. Added some ideas about A*.
37 lines
672 B
Python
37 lines
672 B
Python
CUBE_SIZE = 64
|
|
NUM_X = 20
|
|
NUM_Y = 12
|
|
|
|
#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 |