I'm very new at Python, and I've searched for this answer for a few days now and I'm not seeing an answer. If I missed a post, I apologize and will happily go read that instead. This is more of a conceptual question, so just skimming for answers hasn't gotten me far yet.
I'm trying to use a pen-and-paper RPG system I know as a springboard for learning Python, and I want to divide up turns not just by player order, but by character speed as well.
sample code (there's more, but this is the problem part):
class char:
def __init__(self,name,side,Spd):
self.name=name
self.side=side
self.Spd=Spd
hero=char("Jimbo","good",4)
helplessSidekick=char("Timmy","good",2)
thug1="Crusher","evil",3)
thug2="Bruiser","evil",3)
So Jimbo spd 4, Timmy spd 2, Crusher spd 3, Bruiser spd 3. For the listed characters, I'd want the turn order for one round of combat to be: J,C,B,T,J,C,B,T,J,C,B,J sort of counting down each one until they're all out of speed. I can use a for loop to generate the initial turn order, no problem. But I need a while loop to actually run this because one of them can be defeated and thus no longer in the turn order, natch--and of course that turn order can fall apart if Jimbo KOs Crusher on his first move.
I've been staring at this for a few days and I'm stumped. I apologize in advance for the beginner nature of the question; I've been having a ton of fun with this, but I definitely have a lot to learn. Thank you!