Finite State Machine
Let's focus on the following "finite state machine" (FSM) in the "Game Turn" Event Sheet after the gamer(s) submits a combat turn. (I'm skipping all the "eye candy" that makes the various buttons "twinkle and shine". You can study those event conditions in the Scirra Arcade and the Developer's Guide.)
Read the comments in the above image. I have intentionally "left out" any damage to avatars and their equipment to make this IGM more compatible with any gaming system and rules you might use. You'll have to add those adjustments.
- A problem I discovered while making this engine was "how events work". A layout cycles through its events repeatedly. For this reason, you'll find the "System Trigger once" throughout this event sheet.
- I wanted the combat turns to dynamically display various sprite frames. At first, I embedded the "choose(1,2)" and "choose(2,3)" inside the various events. But then I realized that doing so made the results "flutter" between those animation frames. So, I moved this randomization choice into the "On start of layout" since the gamer re-enters this "combat results" layout after each submission.
- I also wanted a variety of narration statements. Look at the illustration below. It "chooses" between three verbs as compared to events #7 and #8 which use static text.