Every wanted to implement your own turn-based battle system? This tutorial shows you how, with an impressive visual demo, detailed source code and everything you need to get started.
"Our heroes faces a group of trolls. Everyone takes turn to attack, following a priority queue system. Each unit has a priority number and a speed factor that decides when their next turn will be."
"The idea is each one will have a priority number. Each attack bumps up the attacker’s priority number to the max and every cycle (meaning every attack scene we perform) we decrease each unit’s priority number with their speed. The unit with the lowest number attacks next. We will use a priority queue to store these information."