Skip to content
This repository has been 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

Open
1 task
TheoPannetier opened this issue Feb 10, 2023 · 0 comments
Open
1 task
Labels
junior Suitable for junior devs

Comments

@TheoPannetier
Copy link
Contributor

TheoPannetier commented Feb 10, 2023

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);
@TheoPannetier TheoPannetier added the junior Suitable for junior devs label Feb 10, 2023
@TheoPannetier TheoPannetier changed the title Players cannot move anymore when the game is over The game stops ticking and actions are not processed when game is over Feb 10, 2023
TheoPannetier pushed a commit that referenced this issue Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
junior Suitable for junior devs
Projects
None yet
Development

No branches or pull requests

1 participant