Handling World's lifecycle with Hermes library: pause and multiple worlds

edited December 2015 in Library Questions

I'm prototyping a small multilevel game using Hermes.

I'm trying to figure out the best way to freeze a world when the user wants to pause the game: is there a smart way to do that?

Also, I'm thinking of organizing the game in several worlds (one for each level, plus the intro, and other sections). My Idea is that a level that ends will call a worlds "manager" in its shutdown() method, the manager knows what to do and juggles among the various worlds. Does this sound right?

Thanks!

Tagged:

Answers

  • edited December 2015

    Use the deactivate method to pause, then re-call start to resume. You may want to include a bool member variable called _initialized; when it is false, setup will perform initial set-up and flip it to true, and when it is true, setup will do whatever adjustments it needs to make to the current state of the system to resume.

    Your concept for a "WorldManager" sounds good to me. It's likely something that should have gone in Hermes v1, but we overlooked. If you write something good that generalizes nicely, you should submit it via pull request to Hermes! https://github.com/rdlester/hermes

Sign In or Register to comment.