def main(self):
        run = True
        nt = Red(self.ip, self.puerto)
        avatar = nt.obtenerPK()
        clock = pygame.time.Clock()

        while run:
            clock.tick(60)
            avatares = nt.enviar(avatar)

            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    run = False
                    pygame.quit()

            avatar.mover()
            time.sleep(0.02)
            self.repintarVentana(self.ventana, avatares)
Example #2
0
def main():
    run = True
    nt = Red("127.0.0.1", 5000)
    avatar = nt.obtenerPK()
    clock = pygame.time.Clock()

    while run:

        clock.tick(60)
        avatares = nt.enviar(avatar)

        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                run = False
                pygame.quit()

        avatar.mover()
        repintarVentana(ventana, avatares)