Jump to content

How to not recreate everything when changing state ?


Faktori
 Share

Recommended Posts

Hello,

I've been working on a game for 2 weeks. In this game, there will be several maps / levels (2 atm). I want the player to be able to go from one map to another, and back to the first map again. I'm using one game state for each map with a create function that creates every game object the map needs.

So basically it recreates everything when I go back to a map I already visited, and it feels so WRONG !

Do you have any idea on how to improve this ?

Is there a way to 'freeze' a state when I change map, and 'unfreeze' it when I go back to it ? Or should I merge those in one huge map ?

here's the game so you can have a better idea of what it is (if some assets aren't loaded when the game starts, reload the page. This is an issue i'll be correcting soon). 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...