update logic and game AI