C# Any ideas on how to make a turn manager system.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The Glitch

I’m making a three player turn based system. If someone could push me in the right direction. Remember this is using C#.

:bust_in_silhouette: Reply From: Siliwolf

I doubt you’d find anyone who’s willing to write code for an entire system for you, nor is that a very good way to go about game development (or programming in general). That said, here are a few pointers on how I’d approach this. Simply put, you have to keep track of whose turn it is, and do correct operations on that player. I’m generally not a fan of OOP, but I believe it is the best way to go about this in this scenario. You may want to create a class for each player, with all the data in there that you need in it (health, stamina, whatever you need). You can then create methods for any function you need filled, mainly manipulating the data. Then in your main loop, have a reference to the class of each of these players (I’d recommend sticking it in a list so it’s easy to add more players in the future). You can then have a variable that is the current player you’re running operations on. Since the data is in a class and uniform, it should be the same code between all the players if you structure it correctly. I hope this points you in the right direction!

Thank you for pointing me in the right direction.

I will try as soon as possible*

*or when i find motivation

The Glitch | 2023-03-10 22:54