I’m building a multiplayer game that includes rounds. Players are given options to choose and after each finishes picking, the template changes to a voting template. This template shows each players individual choice (option). Players vote for their favorite and then a scoreboard template renders, showing each vote and calculating scores based on vote count. So 3 templates in all - gameplay, voting, scores.
What’s the best way to swap out templates after choices/votes and also preserve the scores? I’ve been using sessions and if statements in the template so when a choice is made a session is changed as well as the template, but this only works client side so player templates aren’t synced up.
From my research it seems like there are many ways to go about doing this - using Iron Router’s route controllers and hooks, template.dynamic, reactive var and dict, - so I’m looking to be pointed in the right direction (best practice?). Maybe put all info in my game collection, update accordingly and use tracker to render templates somehow?