Turning local mechanics into remote gameplay
Now that we can manage players’ interactions and communicate the game state to players, it’s time to implement the core features of a quiz. Coming up, we are going to implement the questions and answers. For that, we are going to use a questions database where we store them with their possible answers and the correct answer index.
Here, we will see how we load and deserialize these questions into QuizPanel
. On top of that, we’ll also understand how we make use of RPCs to keep everyone in sync. And of course, we will also implement the logic behind both when players choose the correct and the incorrect answer.
When a player chooses an answer, we need to compare it with the correct answer index, and if it’s correct, we should notify QuizScreenServer
about the correct answer. We’ll also need to make use of RPCs to keep everyone in sync regarding the current question and answer status.
Moreover, we...