Reseting the game easily

This forum is currently in read-only mode.
  • As the subject says, how to reset the game easily? Some kind of code needed?

  • Reset it how? As in, start the level again? Start the game over again? More information is needed here. What needs to be reset? Score? Ammo? Lives? Enemy placement? Bananas?

    Also, what have you tried in order to reset your game? It's easier to help out with a method that doesn't work than to come up with something from scratch that might not even fit into your game.

  • I meant same as you would push the magical red x and start playing again from the beginning. There's just too many variables to set them all to original values at the "Game Over press space to continue".

    And i mean reseting enemy hp, tower reload time, and other attributes.

  • I meant same as you would push the magical red x and start playing again from the beginning. There's just too many variables to set them all to original values at the "Game Over press space to continue".

    Ah, I see.

    Well, currently that's the only way to do it, unfortunately.

    Actually... I suppose you could Quicksave at the beginning of your game when it first starts up, then use Quickload to return to that state. I haven't used Construct's built-in save features much, but as I understand it it's akin to a save state for an emulator. I think.

    If your game is big on memory resources you could save/load from disk. I don't imagine it would take too much time to restore. You could hide the load time with a fade transition or something to a blank, black layout if it's got a noticeable lag.

  • Good thinking, tho the programm bugs right after the quickload. Gotta do it the slow way then. Thanks anyway.

    E: That was just the first time, now it works perfectly. Although the music stops playing, but its just about the codings..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • change layout to current layout is a quick way, u only need to reset global variables, thats why you should avoid them except when you want trans-layout variables

  • What's the easiest way to change to the current layout? I'm assuming that I need to use the action System -> Go to layout, but how do I get it to pick the correct layout? I suppose I could create a separate reset event for every layout, but I'd rather create a single reset event that works properly no matter what layout it's called from. Is there a system variable that keeps track of the current layout number that I can use?

    I have to say, the layout system confuses me a bit (I'm pretty new to Construct). The layouts are listed by name in the Project panel, not number, and the Properties pane for a layout makes no mention of a number, but when you use the 'Go to layout' action it asks for a number. Not very intuitive.

  • You can enter a name for the layout parameter. Also have a look at the system expressions:

    [quote:36v1yo3b]LayoutName

    The name of the current layout.

    LayoutNumber

    The current layout's number.

  • Perfect! Using 'LayoutName' in conjunction with the System -> Go to Layout action allows me to reset the layout using one abstract Event, no matter which layout the player is on. Thanks Ashley!

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