images.draw_initial_board(board) #respond to input while 1: for event in pygame.event.get(): if event.type==pygame.QUIT: sys.exit() elif event.type==pygame.KEYDOWN: #update robot location on board board.process_keypress(event.key) #move_active_robot(event.key) #animate motion images.animate(board,event.key) print 'key pressed' #check victory condition if board.check_victory(): images.sidebar.update_info_text('You made it to the flag','Congratulations!') elif event.type==pygame.KEYUP and event.key==pygame.K_s: #only for (s)how flags images.redraw_robots(board) #screen.fill(black) #pygame.display.flip() #check victory conditions