Best Practice for loading between game levels

General discussion about the R.U.B.E editor
Post Reply
msm1982
Posts: 17
Joined: Tue Aug 20, 2013 4:13 pm

Best Practice for loading between game levels

Post by msm1982 »

Hi,

sorry if this has been addressed already in the tutorial videos, I am still working my way through watching all of them.

I was wondering what the best practice was for changing "levels" in a game. Specifically I am creating a 2D platformer with multiple "rooms" which I am currently thinking will be loaded as separate RUBE scenes.

Certain parts of the game would need to be loaded in each room/level, such as the main player character. When moving from one room to the next, is the basic strategy to just destroy the existing room's world and all its bodies, load in the new world and also recreate the player character/body in the new world? Or are there better ways to preserve the bodies and elements that should be carried over from room to room (and world to world)?

Thanks for the help and advice
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Best Practice for loading between game levels

Post by iforce2d »

Yes, typically levels would be separate RUBE scenes. There have been some other threads on similar topics which might be good to look at:

How to import a body set from another b2dworld?:
viewtopic.php?f=6&t=153

Loading two json:
viewtopic.php?f=6&t=176

Make some bodies unload:
viewtopic.php?f=6&t=188
Post Reply