This is my first time using Unity (and my third time creating a game in general), so I hope I can provide the needed information to solve this problem.
I want to create a turnbasedturn-based system for my 2D Top/Down RougelikeRoguelike. After the Generationgeneration of the dungeon, there will spawnbe x Enemysenemies spawned based of choosenon chosen difficulty and choosenchosen quest.
How should each turn look like?
Player for example is aan Orc, so he gets 7 movement. (meaning he can move 7 tiles.)
.
In his turn he can move for example 3 tiles, then attack, 2 tiles, use a potion and then uses his last 2 tiles of movement. And then he presses "End Turn" and then the enemysenemies go through theretheir turns (based ofon which typtype of creature therethey are). The Playerplayer can skip his turn completlycompletely, attack and dontdon't move or only move. But he always needs to press the "End Turn" Buttonbutton.
What I would do, tooto solve this issue:
I would create a boolean for every single enemy and the player, then turn them true or false. And whateverwhenever boolean is true, that person can do his turn. But to check this, I would need to put it in the "Update" method. So on every frame there would be x+1 checks (all Enemysenemies plus player), who can move or not.
A second idea would be, to put the player and the enemy in aan array, sort by speed variable (so who goes first, and who goes last) and then I would have my turn order without any boolean. But this still leaves the question, how I would prevent the player of moving or doing stuff, while it is not therehis turn.
I dont thingdon't think any of them would be a good idea. Since I use now Unity, I hope there is a better option for this. And just a heads up, english isntEnglish isn't my first language, but I hope you can understand me. I will happily answer any question.