This should optimise the code, reduce repetition and make it more flexible for future updates (e.g. adding more players if I wanted to adapt it for a different game)
I'll need to move all the current variables linked to player 1 into an object called playerOne, and the same for player 2.
This should optimise the code, reduce repetition and make it more flexible for future updates (e.g. adding more players if I wanted to adapt it for a different game)
I'll need to move all the current variables linked to player 1 into an object called playerOne, and the same for player 2.