Layout Restart, Spawning Powerups

0 favourites
  • 4 posts
  • Hey everyone!

    So, my question today is.

    When I use Keyboard on Press R > System > Restart Layout.

    All of the power-ups will spawn right behind the bricks. Here is a picture of what I am talking about.

    <img src="http://img812.imageshack.us/img812/282/0004z.png" border="0" />

    Now, on the normal start of this Layout everything works fine and those Power-ups only spawn after the blocks have been destroyed.

  • You should reset global variables to their defaults on a start of the layout. That's my guess.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm guessing you have 'brick: on destroyed -> spawn powerup' so when you restart the level it's destroying all the bricks and spawning the powerups. You should use a variable to track if the level is finished and don't spawn the powerups when the level is over.

  • Okay, I have absolutely no idea what I am doing so I kind of threw this all together.

    I created a new global and called it NewLayoutCheck = 0

    On R Pressed > System > Reset Global Variables

    On Layout Start set NewLayoutCheck to 1

    On Brick destroy and NewLayoutCheck not equal to 0 > Spawn Powerup.

    I think there may have been a simpler way of doing this but who knows. For now it works! Yaah.

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