DerangedSenators / copsandrobbers

2D Multiplayer Cops and Robbers Game made with Unity for the Aston University Team project module
https://www.copsandrobbers.co.uk
Apache License 2.0
6 stars 5 forks source link

Spawn locations have been fixed in this pull request #178

Closed nisathnasar closed 3 years ago

ellimanh commented 3 years ago

Round timer is set to 30 seconds currently

nisathnasar commented 3 years ago

Round timer is set to 30 seconds currently

Changed it to 1m 30 seconds in a later commit

nisathnasar commented 3 years ago

In RoundManager, TransformPlayersRound all three methods have duplicated code which is unmaintainable. I think we can improve this by having a struct like:

private struct RoundSpawnPosition{
    public Vector2 CopPosition;
    public Vector2 RobberPosition;
   //Add constructor if required
}

And then storing three instances of this in a list (one per round). Then, you can have one method which takes int param to specify a round or use a global value to determine which struct to use.

I've fixed this could you check if thats what you wanted. If so then I'll remove the old code before merging

nisathnasar commented 3 years ago

I'd put RoundSpawnPosition into a List. Then you won't need the switch statement with repeated code

Do you mean like an array? like

localPlayerRB.position = RoundSpawnPosition[roundNumber-1]?

hsravat-4590 commented 3 years ago

Either or But yeah the example you made pretty much captures it.

nisathnasar commented 3 years ago

Either or But yeah the example you made pretty much captures it.

Check again pelase