def main():
global FPSCLOCK,LIVES,BLANK,BASICFONT,FONTPATH,ALLMOVES
BASICFONT = pygame.font.Font(FONTPATH, BASICFONTSIZE)
FPSCLOCK = pygame.time.Clock()
mousex,mousey = 0,0
boxs = init_boxs_pixel_x_y_relative_BOARD()
#shuffle_boxs_color(boxs)
init_boxs_revealed(boxs)
first_select = None
lives = LIVES
shuffle_boxs(boxs,1000)
while True:
draw_bar(BAR,lives)
draw_board(BOARD)
mouse_clicked = False
key_pressed = False
(boxx,boxy) = (None,None)
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == MOUSEMOTION:
mousex, mousey = event.pos
elif event.type == MOUSEBUTTONUP:
lives -= 1
mousex, mousey = event.pos
mouse_clicked = True
(boxx,boxy) = get_box_x_y(boxs,mousex,mousey)
if (boxx,boxy) != (None,None):
move = boxs[boxx][boxy].can_move()
if move == False:
(boxx,boxy) = (None,None)
global FPSCLOCK,LIVES,BLANK,BASICFONT,FONTPATH,ALLMOVES
BASICFONT = pygame.font.Font(FONTPATH, BASICFONTSIZE)
FPSCLOCK = pygame.time.Clock()
mousex,mousey = 0,0
boxs = init_boxs_pixel_x_y_relative_BOARD()
#shuffle_boxs_color(boxs)
init_boxs_revealed(boxs)
first_select = None
lives = LIVES
shuffle_boxs(boxs,1000)
while True:
draw_bar(BAR,lives)
draw_board(BOARD)
mouse_clicked = False
key_pressed = False
(boxx,boxy) = (None,None)
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == MOUSEMOTION:
mousex, mousey = event.pos
elif event.type == MOUSEBUTTONUP:
lives -= 1
mousex, mousey = event.pos
mouse_clicked = True
(boxx,boxy) = get_box_x_y(boxs,mousex,mousey)
if (boxx,boxy) != (None,None):
move = boxs[boxx][boxy].can_move()
if move == False:
(boxx,boxy) = (None,None)