Turn based combat help PLEASE

Godot Version

4.6

Question

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.

Damn it’s been a while since I wrote a post myself. Sorry for the wonky formatting

You don’t know how to determine whose turn it is and which of their units is supposed to move/attack?

1 Like

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.

I’m not very familiar with turn based combat, can you explain your gameplay a little bit.

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.

3 Likes

Thanks that seems helpful. Have to wait a bit to try it out but will as soon as I can. Going to mark it as solution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.