Nodragem Posted November 15, 2018 Share Posted November 15, 2018 Hello, I am trying to make my game state flow these days; I was wondering if Babylonjs has something ready to manage game states? An instance of game state flow would be: MainMenu --> LevelSelection --> LoadingScreen(Level1) --> Gameplay --> WinningScreen --> LoadingScreen(Level2) --> Gameplay --> WinningScreen --> LoadingScreen(Level3) --> Gameplay --> PauseMenu --> MainMenu --> Exit More documentation on what I mean here: http://gamedevgeek.com/tutorials/managing-game-states-in-c/ or https://rareelementgames.wordpress.com/2017/04/21/game-state-management/ Here are examples of game engines that implemented this pattern: - LibGDX: https://github.com/libgdx/libgdx/wiki/Extending-the-simple-game (they named the states Screens, and the mananager is Game) - Phaser 2: http://perplexingtech.weebly.com/game-dev-blog/using-states-in-phaserjs-javascript-game-developement - Phaser 3 (renamed Scenes): https://phaser.io/phaser3/contributing/part5 Any thoughts? How do you manage your game states with Babylonjs? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 15, 2018 Share Posted November 15, 2018 In my case I use either scenes or containers (https://doc.babylonjs.com/how_to/how_to_use_assetcontainer) Quote Link to comment Share on other sites More sharing options...
jerome Posted November 16, 2018 Share Posted November 16, 2018 Currently there's not such a thing per se in BJS. I intended to implement one but didn't find the time up now. I did a first simple proto in the game StarFighter. You could get the code here https://github.com/jbousquie/OfficeGames/blob/master/StarFighter/StarFighter.js#L1480 the scene orchestration logic (scene linking, what's different from a game to another one ) is to be implemented here https://github.com/jbousquie/OfficeGames/blob/master/StarFighter/StarFighter.js#L1505 Then the object is created and used from here only in the following lines : https://github.com/jbousquie/OfficeGames/blob/master/StarFighter/StarFighter.js#L1552 brianzinn 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.