Open this project's Event Sheet and add three (3) global variables. Here's what I've called mine.
- reward = 0 -- prophecy of coming events
- Rolling = 0 -- roll those eyeballs as if they were slot machine windows.
- silver = 100 -- grants our gamer some cash; OR integrates with your parent RPG.
Let's add the following conditions when our game is launched.
I'm using W3Schools CSS as a project file. It is just as robust as BootStrap but thousands of bytes smaller! Doing so also avoids all those "hefty image" files that are replaced with CSS management. The "txt_story" is a short narrative from my parent RPG -- Legends-of-Renown-Deeds.com.
Animate the Eyes
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 eyes.AnimationFrame and eyes.AnimationSpeed. The "Rolling" variable acts as a toggled light switch; the game is either spinning or not. My Events #3 to #6 are that spinning process. Events #7 to #9 stop the spinning process. See the illustration below.