Launching A Duel
As I said before, I've studied all of the C2 and C3 slot machine tutorials -- many of them were rather complex and "over-thought". In ours, we'll simply use the attacks.AnimationFrame and attacks.AnimationSpeed. There are several things we're looking for:
- Event #8: -- Did the gamer pay the correct registration fee? Then we must deduct that amount from the gamer's coin purse. The winner earns back all the coins paid into the duel combat rounds by themselves, any bets placed(?), and those their opponent paid. The "Rolling" toggle is turned "ON". Once a gamer chooses a combat intensity, it becomes locked!
- Event #9: -- If this is the duel's beginning (i.e.: "gameTurn = 0"), I create a duel introduction inside the "txt_story" text field. I give the game 1.5 seconds to read this introduction. You might consider creating a randomized introduction; we'll learn how to do this in a minute.
- Event #10: -- Manages the "gameTurn" counter.