def main():
global FPS,BASICFONT,BASICFONTSIZE
FPSCLOCK = pygame.time.Clock()
BASICFONT = pygame.font.Font(FONTPATH, BASICFONTSIZE)
mousex,mousey = 0,0
connection,addr = None,None
init_cross(cross)
init_crosspos(CROSSPOS)
#print CROSSPOS
Turns = 1
draw_board()
CREATEGAME_SURF, CREATEGAME_RECT = makeText('Create Game', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 90)
JOINGAME_SURF, JOINGAME_RECT = makeText('Join Game', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 60)
DISPLAYSURF.blit(CREATEGAME_SURF, CREATEGAME_RECT)
DISPLAYSURF.blit(JOINGAME_SURF, JOINGAME_RECT)
Lock = True
player = None
while True:
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:
mousex, mousey = event.pos
if CREATEGAME_RECT.collidepoint(event.pos):
connection,addr = create_game()
player = SERVER
Lock = False
if JOINGAME_RECT.collidepoint(event.pos):
sock = join_game()
player = CLIENT
Lock = False
global FPS,BASICFONT,BASICFONTSIZE
FPSCLOCK = pygame.time.Clock()
BASICFONT = pygame.font.Font(FONTPATH, BASICFONTSIZE)
mousex,mousey = 0,0
connection,addr = None,None
init_cross(cross)
init_crosspos(CROSSPOS)
#print CROSSPOS
Turns = 1
draw_board()
CREATEGAME_SURF, CREATEGAME_RECT = makeText('Create Game', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 90)
JOINGAME_SURF, JOINGAME_RECT = makeText('Join Game', TEXTCOLOR, TILECOLOR, WINDOWWIDTH - 120, WINDOWHEIGHT - 60)
DISPLAYSURF.blit(CREATEGAME_SURF, CREATEGAME_RECT)
DISPLAYSURF.blit(JOINGAME_SURF, JOINGAME_RECT)
Lock = True
player = None
while True:
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:
mousex, mousey = event.pos
if CREATEGAME_RECT.collidepoint(event.pos):
connection,addr = create_game()
player = SERVER
Lock = False
if JOINGAME_RECT.collidepoint(event.pos):
sock = join_game()
player = CLIENT
Lock = False