Skip to content

Resolve "Remove final hindrances to make multiplayer work"

Changes made in this merge request

  • Refactor: GameStateTank to Stats and add a void update(Tank tank) method

  • Refactor: logic for setting GameState in GameController, using the method void initializeGameState() to initialize it in the first fetch call. Update the GameState in void endPlayerTurn().

  • Fix: call endPlayerTurn when gameStatus is set to true. Ensures that the opponent is informed about the fact that the game has ended.

  • Fix: Introduce boolean gameStarted to ensure that the first animation plays properly

  • Fix: Make win and lose banners show in the end by refactoring void checkGameOver() method

  • Fix: Stop polling by checking the gameStatus field

  • Fix: Change if-statement for tank movement to avoid getting stuck on edges

  • Fix: Give tank1's bullet id "bullet1" and tank2's id "bullet2", and update CollisionDetection to register hits on the opposite tank's bullet.

  • Fix: Check gamestatus field in void endPlayerTurn() onResult to stop receiving move data after game is done. Consequently, the win banner will not be overwritten by the "Your turn" banner.

Discovered problems during testing

  • Tank gets stuck on edges
  • m_bodycount < m_bodyCapacity -> Moved to different MR
  • Tank 1 takes no damage
  • Ensure that tank is not instantiated before terrain has been fetched -> Look at in different MR
  • Win banner does not show, sometimes?

(Extra) Manual retry during gameplay on lost connection

Closes #62 (closed)

Edited by Sander Østrem Fagernes

Merge request reports