| |||||||||||
PyWeek - HelpI've got this code, but it's only being run once, why:while (1==1): cursor_pos = pygame.mouse.get_pos() cursor_pos_x = int(cursor_pos[0]) cursor_pos_y = int(cursor_pos[1]) The last three lines are tabbed — john on 2007/04/02 13:00 of |Gunboy Comments: (log in to comment) |
Last Challenge
September 2008 [entries, ratings] Previous March 2008 [entries, ratings] September 2007 [entries, ratings] > April 2007 [entries, ratings] September 2006 [entries, ratings] March 2006 [entries, ratings] (June 2006) August 2005 [entries, ratings] Not logged in Login | ||||||||||
By mangobrain on 2007/04/02 13:32:
You aren't calling pygame.event.pump() (or .poll(), or .get(), or similar). The code is probably running just fine, but I think that if the event loop isn't being updated, then new input state won't propagate into things like mouse.get_pos() or key.get_pressed().By john on 2007/04/02 14:45:
Thanks! It's working now!