Skip to content

Ending a Game

Properly ending a game session is crucial for ensuring all game data is correctly recorded.

Basic Usage

void end_game(sb_game_handle_t state) {
    // Mark game as finished - this automatically commits
    sb_set_game_finished(state);
}
void end_game(scorbit::GameState& gs) {
    // Mark game as finished - this automatically commits
    gs.setGameFinished();
}
def end_game(gs):
    # Mark game as finished - this automatically commits
    gs.set_game_finished()

Automatic Commit

setGameFinished() automatically commits the final state. You don't need to call commit() separately.

Session End

Once a session is closed, you cannot make further updates to scores or modes.