f10

来源:互联网 发布:公众平台源码 编辑:程序博客网 时间:2024/04/30 01:17
 if player == CLIENT:
          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                                 
                          i,j,x,y =  get_position_clicked(CROSSPOS,mousex,mousey)
                                    if (i,j,x,y) != (None,None,None,None):          
                          sock.send(str(i)+" " +str(j) + " "  + str(x) + " "  + str(y) )
                                        cross[i][j] = 1
                          pygame.draw.circle(DISPLAYSURF,WHITE, (x,y), 10)
                                        logger("client","send()")
                         buf = sock.recv(1024)
                                        i,j,x,y = tuple(buf.split(' '))
                     i,j,x,y = int(i),int(j),int(x),int(y)
                        pygame.draw.circle(DISPLAYSURF,BLACK, (x,y), 10)
原创粉丝点击