while not Sended:
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
i,j,x,y = get_position_clicked(CROSSPOS,mousex,mousey)
if (i,j,x,y) != (None,None,None,None):
connection.send(str(i)+" " +str(j) + " " + str(x) + " " + str(y) )
Sended = True
break
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
i,j,x,y = get_position_clicked(CROSSPOS,mousex,mousey)
if (i,j,x,y) != (None,None,None,None):
connection.send(str(i)+" " +str(j) + " " + str(x) + " " + str(y) )
Sended = True
break