ios – Unable to recreate the game setup process for Avalon in Swift


I need some help with my first app that I wanted to create in Swift and SwiftUI. I wanted to make an app version of the social deduction game Avalon. In Avalon, players are given cards with a character on them and each character has a role. During the game setup, all players have their eyes closed and a narrator calls on players to see characters if their role requires. For example, Merlin’s role is to see all evil players, so the evil players will have their thumbs up while Merlin is called to open his eyes and see which players are evil. I wanted to replicate this game setup process in Swift. Each player will be handed the device when a button appears with their name. Pressing the button reveals the player’s character and role, including any players they needed to know about, then the player presses “done” and this process repeats for the other players. So far I have a dictionary that holds the player names as keys and randomized characters as the values. The characters are cases from an enum. The problem I have is that I don’t know how to go about doing the role descriptions and the part when the player has to “see” other players.

I created a switch statement in the character enum and switched on the characters for the role descriptions, but I can’t use string interpolation to add the names of players that some of the characters need to see. If anyone has any advice for how I can accomplish the game setup process in the simplest way, I would greatly appreciate it! I have about ~6 months of experience.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img