# RPG Battle Order

**URL:** <https://forum.kirupa.com/t/rpg-battle-order/211073>\
**Category:** flash\
**Created:** [December 26, 2006, 10:27pm UTC](https://forum.kirupa.com/t/rpg-battle-order/211073 "2006-12-26T22:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)\
**Post date:** [December 26, 2006, 10:27pm UTC](https://forum.kirupa.com/t/rpg-battle-order/211073/1 "2006-12-26T22:27:18Z")

</div>

I am trying to develop a battle system order engine which determines the order of turns according to player(s) and enemy(s) speed. For example, let’s say that player A has a speed of 4 and player B has a speed of 2. The order of battle would be like this: Player A, Player A, Player B, Player A, Player A, Player B, Player B, etc. Since Player A has twice as much speed has Player B, player A goes twice for every turn that Player B makes. Does this make since?

I have absolutly no clue how to do this (though I am experienced in AS, I haven’t ever came across this kind of scenario - so I have absolutly NO clue where/how to begin and debug it. If isn’t to much to ask, can someone provide a small snippet of code for me. Please?

Thanks in advance.

\*Also, if it isn’t too much to ask, can you make flexible enough so that there would be more players in battle (Player C with a speed of 1, Player D with a speed of 5)? This isn’t a biggy right now, but would be very nice. Thanks
