[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] timer, update



lorca wrote:

Hi, how can i do that the image update every 300ms, for example:

a = get_time()
while 1:
   if get_time() > (a + 300ms)
       updateImage()
       a = get_time()

i need the methods to get time

PS: sorry for my english

it was easy:

x = pygame.time.get_ticks()
i=0
while 1:
   if pygame.time.get_ticks() > (x+300):
       print i
       x=pygame.time.get_ticks()
       i=i+1