Restart just parts of the layout

0 favourites
  • 6 posts
  • Hello,

    I got a question.

    So I'm making a platformer game and I'm stuck at something.

    There's a part in the game where the player has to stand on a platform, and while doing that it triggers the platform to go up (using the bullet behaviour), then you need to manouvre around obstacles and such.

    If you get hit by an obstacle, you die and respawn at the nearest checkpoint.

    Now here's my problem; when the player dies, the platform is still going up, while the player is back at the beginning of the level where the moving platform started (but isn't anymore..), meaning the player can't proceed since the platform isn't there anymore.

    The simple solution would be to just restart the layout, but I was hoping there would be another solution since my checkpoint system doesn't work with restarting the layout..

    can anyone help me? If anything is not clear I can post pics or cap to show what I mean..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Restarting the layout seems... kind of harsh too here.

    You have some kind of lift, and it doesn't stop going up, here is your problem. You should have it go down after some time. What if the player falls from the lift ? Is he supposed to suicide in order to restart ? It would be strange...

    If at some point you detect that the player is on the platform, you could also start to test if the player is still on the platform, or if the platform has reached its top position. When this happens, you could then start to move the platform down again.

    If all this doesn't go with your plan, you could also use the "savestate" functionality. At the start of the game (after the layout starts), save your game (System : Save). At the end, just reload this save. Now, add the behavior "nosave" on everything that is supposed to not be reset between the player's try, like the highscore, the number of life, ... And here you go

  • give the platform 2 instance variables (startx and starty) and when the player dies call a routine that just sets the platform back to these remembered points.

  • Thanks guys, will try both and pick which one suits better!

  • Thanks! helped alot

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