-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine winner after specified laps #10
Comments
I'd like to work on this. Would you mind if I added an "EndState" or sth similar that could transition to the waiting state or end the game? I think that would make it easier to implement e.g. a score screen or a play again button later. |
I think this is a good idea. This could later be extended with GUI to show a scoreboard. |
I've ran into a problem because the server seems to be not aware of the other player spatials. I'm not sure if I missed anything though the server creates it's own player object and is able to query it. Any other players are not available. If that is the case, should I implement some kind of status message? I think #7 should be completed first though. My code currently adds new fields to the player spatials that contain the completed laps and the playerIndex. The laps are queried by the server on PlayState update, this could probably also be done in collision. |
Either #7 or #8 will need to be completed before this can be completely completed. I would say at first just make sure it can determine in general if someone has won. Once player input is accepted and the server has its own players, which is what I'm currently working on, then that can be specialised for the server. |
The server should take a parameter specifying the amount of laps. After the first player finishes that many laps, the server ends the game (moves into the waiting application state) and broadcasts to clients the winner as a reliable message. Each client prints the winner to the console and then ends the game (complete shutdown of engine).
The text was updated successfully, but these errors were encountered: