tresinformal / drakkar

The tresinformal video game called 'Drakkar'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The game options contain a time limit

TheoPannetier opened this issue · comments

Context

We want the game to be over after playing for some time. A first step towards this is to make sure the game has a time limit set at construction, via the game options.

Test

  • Test is ready and on develop
//#define FIX_ISSUE_681
#ifdef FIX_ISSUE_681
  // (681) The game_options set a time limit
  {
    const int max_time = 500; // change if too long/short
    const int seed = 3;
    const bool music_on = false;
    const key_action_map any_kam_will_do = get_random_kam();

    game_options random_game_options = game_options(
          seed,
          music_on,
          any_kam_will_do,
          any_kam_will_do,
          any_kam_will_do,
          environment_type(),
          max_time
          );
    assert(game_options.get_max_time() == max_time);
  }
#endif // FIX_ISSUE_681

fixed by #689