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

Invulnerable players cannot shrink or grow #382

Open
1 task
Clemcarle opened this issue Sep 22, 2021 · 1 comment
Open
1 task

Invulnerable players cannot shrink or grow #382

Clemcarle opened this issue Sep 22, 2021 · 1 comment
Assignees
Labels
depends Depends on another Issue junior Suitable for junior devs

Comments

@Clemcarle
Copy link
Contributor

Clemcarle commented Sep 22, 2021

When a player is invulnerable, they should not shrink upon collision with another player.

#ifdef FIX_ISSUE_382
  ///An invulnerable player cannot shrink
  {
    game g;
    
    //Make the first player invulnerable
    become_invulnerable(g.get_player(0));
    
    // Make player 1 and 2 overlap
    g.get_player(1).set_x(g.get_player(0).get_x());
    g.get_player(1).set_y(g.get_player(0).get_y());
    assert(has_collision(g));
    
    // After a tick, invulnerable player does not shrink
    const int inv_player_size_before =  get_nth_player_size(g, 0);
    g.tick();
    const int inv_player_size_after =  get_nth_player_size(g, 0);
    assert(inv_player_size_after == inv_player_size_before);
  }
#endif
Clemcarle added a commit that referenced this issue Sep 22, 2021
@Clemcarle Clemcarle changed the title Invulnerable players cannot shrink [WIP] Invulnerable players cannot shrink Sep 22, 2021
@Clemcarle Clemcarle added depends Depends on another Issue junior Suitable for junior devs labels Sep 22, 2021
@TheoPannetier TheoPannetier added this to the Player size milestone Sep 28, 2022
@EvoLandEco EvoLandEco changed the title Invulnerable players cannot shrink Invulnerable players cannot shrink or grow Dec 23, 2022
@EvoLandEco
Copy link
Contributor

An invulnerable player should have no clip with others, thus no grow either

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
depends Depends on another Issue junior Suitable for junior devs
Projects
None yet
Development

No branches or pull requests

3 participants