How do I is there away to reset only part of the layout?

0 favourites
  • 5 posts
From the Asset Store
Plugin Transition Layout C3. Layout opening and closing animation for C3. Quickly set up transitions between lay
  • Think flappy bird, but more of a platform game ... and with a turtle with a jet pack.

    When the turtle gets to the bottom of the platform game he collides with an invisible sprite that sets his position back to where he started. This does not end the game, the turtle keeps going through the level collecting points, coins and whatnot until he dies.

    Here's the thing, when the turtle goes back to the starting point I need everything he has collected or knocked over to reset, but Not the score. So if the turtle collects 50 coins the score needs to continue to read 50 coins and continue to add coins, but all the coins, even those he has collected need to be back to where they were the first time he went through the level so he can collect everything a second (third, forth, fifth) time.

    How do I reset where the coins, boxes and other objects were physically without resetting the score?

    EDIT I solved half my problem. I have the coins invisible and then visible once they player gets back to the top (instead of destroying them).

    But how do I reset the boxes that have fallen on the ground so they are all back up in position (stacked on top of each other)? Those don't vanish when hit.


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How are you keeping score because you should be able to restart layout, the score should be an unaffected global variable.

  • On start of layout the scores reset to 0. So when the layout restarts the scores go to 0.

  • You can store the initial position of the box in their instance variable(initial_X and initial_Y) when start layout.

    Then you set it back to the initial position when you need reset the level without restart layout.

  • Or restart the layout, but don't reset the score in "On start of layout" event. Only reset the score when you need to do so, for example, when the character has died.

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