Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

The game stops ticking and actions are not processed when game is over #716

Description

@TheoPannetier

Depends

Context

Once the game has reached the time limit, it should not be able to tick any further, and further input actions should no longer be processed. For example, players should not move forward despite being given the instructions to do so.

Test

// The game is already ticked until over
    // (716) Game no longer ticks after game is over
    const int n_ticks = g.get_n_ticks();
    g.tick();
    assert(g.get_n_ticks() == n_ticks);

    // and as a result, no further actions are processed
    // for example, players are not moved
    player& p = g.get_player(0); // ref to player one
    const coordinate initial_position = p.get_position();

    add_action(p, action_type::accelerate_forward);
    g.tick();
    assert(p.get_position() == initial_position);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    juniorSuitable for junior devs

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions