Ok I cave in. For a few months I’ve been designing a turn based 2d game idea I want to make. Then for about 2 months now I have tried to get the basic turn based combat working. I don’t know why but something about it isn’t clicking in my brain. I would love to just give some code with bugs but I don’t have any code to give cause I restarted about 5 times now. Could someone give some advice, tips or just a guide on how to make simple turn based combat. All I need for now is to know how to make the enemy party and my party be in turn based combat where as in most games and agility or speed variable controls turn order. I hope that’s not a too big ask, I know it’s kinda hard to help on a question like this lol.
It’s kind of just I start coding and it goes semi well but then it falls apart somewhere cause it’s not structured well. The best thing would be to know what the actual “building blocks” of the system are. Cause I’m just not sure what they are rn.
Make a small text based prototype that implements turn logic and state.
Use two inner classes; Player and Unit. Player implements a list of units. Unit has the priority property.
Maintain a list of players and the index of player that’s currently playing. Sort each player’s units list by priority. Maintain an index of currently active unit.
When space is pressed print “Player X, Unit Y” and advance (or reset) both of your indexes.