game logic to py