foundations for game logic