updates AI and game logic