- Home /
How to simulate Turns in Turn Based Strategy Game?
Hello all. My group is doing a turn based strategy game using a hex grid. The objective I seek is to simulate a turns system between the player and the AI.
The simulation is envisioned to be shown as each unit moving individually one at a time and commencing its attack if possible. Right now, I made a temporary system that does all the AI unit's actions at once upon ending a turn. Think Fire Emblem or other turn system where enemies move one at a time and does what it does; this is something I am trying to achieve.
Here is a pic of the current grid state. Once the player units(blue) ends the turn by clicking the turn end button, the enemy moves all its units and does something each. How can I go about accomplishing this? Does Time.deltaTime play a factor in doing so?
Also, I can move this question to the forums if the moderator deems necessary, but I just want some quick links or advice as to how to get what I need. Thanks.
Answer by getyour411 · May 31, 2014 at 06:13 PM
foreach (enemy in aiUnits) {
// do stuff
}
debug.log("AI turn over");
Keep a list of aiUnits
That does everything at once. I'm looking for a one at a time effect here. So I do understand that is necessary, but again, looking for a delay between each unit's actions.
That doesn't do everything at once since it's an iteration through a loop; if you need a pause just do
foreach(this in That) {
// do stuff
// pause 5 seconds
}
Or provide a more specific example of what you are looking for