capalmer1013 / 2d-survival

2 stars 3 forks source link

Med kit pick up fixed #32

Closed OtoStanko closed 2 years ago

OtoStanko commented 2 years ago

Added functionality to the Health object (med kit) so it would not be picked if the health of the player is at maximum. Also had to change the order of collision from

  1. a.collide(b)
  2. b.collide(a) To:
  3. b.collide(a)
  4. a.collide(b) This prevents the case when health of the player is not at full when colliding with the medkit, but will be restored to full as a result of the medkit. It caused the player to heal, but as player was healed, the medkit remained on the ground.