Resolve "Remove final hindrances to make multiplayer work"
Changes made in this merge request
-
Refactor:
GameStateTank
toStats
and add avoid update(Tank tank)
method -
Refactor: logic for setting
GameState
inGameController
, using the methodvoid initializeGameState()
to initialize it in the first fetch call. Update theGameState
invoid endPlayerTurn()
. -
Fix: call
endPlayerTurn
whengameStatus
is set totrue
. 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)