Ejemplo n.º 1
0
 def run(self):
     port = 8888
     s = Listener(port, MyHandler, self)
     
     print"running"
     
     while 1:
         key=pygame.key.get_pressed()
         if key[pygame.K_ESCAPE]:
             self.start_new_game()
             sleep(1)         
         poll(timeout=0.001) # in seconds
         self.process_client_inputs()
         time_passed = self.gametick()            
         self.send_state(time_passed)
         # comment this out to improve performance 
         self.drawgame()
Ejemplo n.º 2
0
    def run(self):
        port = 8888
        s = Listener(port, MyHandler, self)

        print "running"

        while 1:
            key = pygame.key.get_pressed()
            if key[pygame.K_ESCAPE]:
                self.start_new_game()
                sleep(1)
            poll(timeout=0.001)  # in seconds
            self.process_client_inputs()
            time_passed = self.gametick()
            self.send_state(time_passed)
            # comment this out to improve performance
            self.drawgame()
Ejemplo n.º 3
0
 def periodic_poll(self):
     while 1:
         poll()
         sleep(0.005)  # seconds
Ejemplo n.º 4
0
 def periodic_poll(self):
     while 1:
         poll()
         sleep(0.005)  # seconds
Ejemplo n.º 5
0
 def run(self):
     port = 8888
     server = Listener(port, MyHandler)
     while 1:
         poll(timeout=0.05) # in seconds
Ejemplo n.º 6
0
 def update(self):
     poll(0.01)