How do I reset a game ?

  • I would Just do if invisable and visable way

    example: if player hit enemy set Sprite 2 visable/Invisable

    system on start of layout set sprite 2 visable/invisable

    Hope i helped

  • Actually I am looking for a solution to this (see attached .capx)

    click red square to go to game layout

    left or right mouse to move, hit yellow bar and return to start layout

    Problem is I have used reset/destroy/reload but you will notice that "score" will not show on second enter to game layout.

    I have a solution in mind and the is to drop the start/menu layout and just reload but I would rather not if???

    Thanks for any help

    Ed

  • Actually I think you have to use "reset global variables"

    Are you saying objects with Persist behaviour will be restored to default with this action?

  • Well I have no idea if this will help anyone else but I've found my issue:

    Global yes/no --- NO

  • oceldot : yes !

    And as shows plikrus picture, it seems that a persist object is a "global" object

  • Well, I don't see any improvement. My objects with Persist behaviour will still stay dead/destroyed (or whatever state they were in when layout was reset) no matter if I set Global to No or Yes, when using the Reset global variables to default action. I think actually not using Persist might be a better option in my game.

  • Actually you're right. It doesn't work with persist objects ... That sounds a bit weird that there's absolutely no way to reset such objects.

  • Indeed, the persist behavior doesn't seem to have been thought for the "reset" case.

    That's something Ashley might want to have a look on, to add a way to reset a game that uses Persist behaviors.

    In the absolute, I think the persist behavior wasn't really intended to be used in such games since its point is to remember the state of the objects, so you are expecting a persistent world, not necessary a world you would reset/start from scratch all over again.

    Global property set to "Yes" just makes that the instances don't get destroyed when moving from a layout to another. The object that is set to global also stays at the same position when changing the layout.

    So it does not sit well with the persist behavior anyway.

  • So maybe we should use a posivite global property for persistant objects ? I will try that, thanks

  • Indeed, the persist behavior doesn't seem to have been thought for the "reset" case.

    That's something Ashley might want to have a look on, to add a way to reset a game that uses Persist behaviors.

    In the absolute, I think the persist behavior wasn't really intended to be used in such games since its point is to remember the state of the objects, so you are expecting a persistent world, not necessary a world you would reset/start from scratch all over again.

    Global property set to "Yes" just makes that the instances don't get destroyed when moving from a layout to another. The object that is set to global also stays at the same position when changing the layout.

    So it does not sit well with the persist behavior anyway.

    A bit off topic, but are you saying I could use Global=Yes to keep a moving object start in a new layout at the same place it stopped in the previous layout, instead of using variables and set position actions?

  • oceldot: That's a possibility indeed. But whether it's the most appropriate solution depends on the game you're making and how you did it so far.

    It's just one available tool.

  • oceldot: That's a possibility indeed. But whether it's the most appropriate solution depends on the game you're making and how you did it so far.

    It's just one available tool.

    Thanks, I'll play around and see which option works best for me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It seems Global was just what I needed. Say, would it have any effect on performance to use Global on all of my HUD objects? If I only need to put the objects there in the first layout, maybe it would save some memory as I don't need to put them there on other layouts.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)