How do I stop synced objects "resetting" when host is suspended?

  • Hi,

    I'm still fairly new to Construct. I'm working on a 2 player battle card game, which I'm starting to test out now, but on the last test with a friend of mine I noticed an issue.

    If the host minimizes the window, it obviously suspends the game, but this causes an issue on the peer side. The positioning, and various visual aspects, including the visibility, of card sprites on the screen is controlled by various instance variables, which trigger certain events as cards are played to get them to become visible and display in the correct position.

    Once the host's game is suspended for around 10 seconds, the peers game seems to refresh, and all of the sprites disappear for a moment, then they reappear/rearrange themselves on the screen, but most of them are invisible as the event to make them visible doesn't trigger again.

    I've read on various other posts that I might want to look at' on suspended'/'on resume' events to combat this, but I haven't seen anything referring to this exact situation, so I'm unsure how to implement it in this scenario.

    I could write events that would re-trigger the visibility of the correct sprites when this happens, but, firstly, I suspect these would have to be every tick events, which is obviously not ideal, as it may override other events, and secondly, even if I can get them to retrigger properly, there will still be a blip where everything disappears for a moment on the peer's side.

    Here's the project file

    https://www.dropbox.com/s/yfis0na3hgj9lh4/Pixel%20Ships-Changing%20to%20nwjs%20save.c3p?dl=0

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)