Scene states

This is probably a dumb question, but we’re scratching our heads and could use a little help…

Our game is a retro-arcade-pro-wresting game. It has one “main gameplay” screen, that is started from pressing PLAY in the “menu screen.”

When the user hits PLAY in the “menu screen,” the gameplay loop starts as soon as the “main gameplay” screen" loads. Meaning the game loads and the characters on screen go right into their gameplay loops.

What we would like to have happen is for an action to play out on the "main gameplay’ screen before the main gameplay loops starts. (The referee in the game would wave for the fight to start, then have the gameplay loop start.)

Is there a way to set “game states” on one screen? something like:

MAIN GAME SCREEN
Pre fight state
then
fight state

I’m assuming this is how we would go about this, but any direction would be super helpful.

Thanks!!!

2 Likes

Not super sure of what you need but along with using Monarch for screen management I use a phase.lua file to keep track of current game phase, change current game phase, and then block/allow depending on current game phase.

phase.lua

local M = {}

M.current = 0
M.paused = false

M.PRE_GAME = 0
M.MAIN = 1
M.WAIT = 2
M.POWERUP = 3
M.GAME_OVER = 4
M.END_OF_LEVEL = 5


return M
local phase = require("utils.phase")

if phase.current == phase.MAIN then
...
2 Likes

Ooh, is this by any chance the awesome-looking Rumblefest game?

2 Likes

Yup! @Axel That would be the one! Thanks for the kind words. We’re gearing up for the beta release. Looking forward to getting the game in peoples hands to get some feedback.

3 Likes

Thanks @Pkeod, I think this helps answer my confusing question.