Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
562
Reaction score
807
First Language
English
Primarily Uses
RMMV
Introduction
Scenes are the backbone of your project in RMMV. There are many scenes such as the map scene, menu scene, and battle scene. If you plan on adding new menus in your game, scenes are an important concept to understand. So, what's a scene?

What's A Scene
Scenes are parts of your game that contain and showcase an element of your game. Similar to how a director may have a battle scene which showcases a battle. Now, scenes in code are different; scenes act as containers.

Scenes in code contain the windows, sprites, information and game logic for how the scene should run; they're like a big bag with a life cycle. This is because anything in your program eventually has to be terminated, so what's the life cycle of a scene like?

Scene Life Cycle
SceneLifeCycle.png


The game logic and all the assets contained within the scene exist within the scene's life cycle. The life cycle of a scene is handled by the create, start, update, and terminate methods. First, the important parts are created; this is when the windows, sprites, and any important properties are created. Next, the scene is started; when the scene starts, processing of information and game logic begins, which is when we begin the update loop. The update loop is where the main game logic that keeps the scene running every frame is processed; taking input from the player and managing states goes here. Finally, if the scene ever needs to be changed, the scene terminate method is called; this method is usually called by user input or game logic. Now, moving from scene to scene requires using the SceneManager class.

Scene To Scene
Unless your coding, switching scenes manually is something you won't do. However, to go from scene to scene requires using the SceneManager.

The SceneManager changes the scene for the player and has two key methods: goto and push. Using these correct is crucial to managing scenes correctly, or your game might explode.

When To Use Goto & Push
The goto method in the SceneManager class goes directly to a scene. This is great to use if you want to go from one non-relatable scene to the next. But, if you're going into a menu from a menu, consider using push instead.

The push method goes to the new scene, but if you use the pop method on a scene, you'll return to the previous scene. Push is almost always better to use for menus. For creating scenes like game over, use goto instead.

For those who develop and creates new scenes in RMMV, any information you'd like to add? Comment down below!!
 

Latest Threads

Latest Profile Posts

Too bad the Boss Battle Build Bout isn't also for VXAce.
I might not participate in the Boss Battle contest after all... I have more important things to do, like Wishful Wanda. And of course the Dark Deception spinoff I plan to pitch, Demon Slayer.
Changed my avatar, goodbye Alan Sugar, hello George Carlin (one of my favorite human beings ever)
If you still don't subscribe our Polish channel please consider it :)
1.png
Who wants to see my review of the worst star wars movie? This movie has all the excitement of being on Jury Duty of the most boring case ever about trade negotiations.

Forum statistics

Threads
115,171
Messages
1,087,814
Members
149,724
Latest member
scurvyDan
Top