New layout issue / unwanted sprite spawning

  • Hi.

    When the new layout loads, i see the blood splat animations spawn. I assume this is because once the new layout is loaded the previous monsters are destroyed and it then spawns the animation on the new layout.

    How can i prevent them from spawning on the new layout.

    Any advise would be appreciated.

    event is

    on monster destroy -> spawn "bloodsplat animation sprite"

    on bloodsplat animation finished -> destroy "bloodsplat animation sprite"

    Then if the player dies

    on player health = 0 --> go to "end game layout"

    Thanks

  • Use a global variable to track if the level is over or not and only spawn the blood if level is not finished.

  • You can also possibly make a "On start of layout" event and put a "bloodsplat destroy" action in it.

    It's unlikely that the bloodsplats are rests from the previous layout, since when you go from a layout to another, instances are automatically destroyed (unless you've set your object type to be global, in which case the instance would "survive" from a layout to another. In that case, simply put the "Global" property to "No").

  • Thx guys. I tried the global variable, couldn't pull it off. So i went with the event sheet for layout 2 and did the on start of layout destroy blood.

    That seemed to have done the trick.

    Thank you. :)

  • I had this problem. What you have to do is make a family for each of your text, particles and sprites and destroy them at the end of the layout. This might be a good one line option to put in when we are changing layouts as it can cause a lot of problems.

  • Ya I had to destroy almost every object manually in my game (none of them are global) so it's probably a bug that some objects transfer somehow (although I haven't checked if its been fixed in recent months).

  • I will try the family thing. Will be easier. Noticed it must be a bug. Objects are not global but do get transferred.

    So no it hasn't been fixed.

    Im pretty excited. Trying for buying. Hoping the dev's would keep improving the Tool. Its a really awesome app compared to others ive tried. Especially for people who cant code like me.

    Making good progress on my game :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have some globals that were showing up in unwanted places on other layouts. I noticed they were all on the 0 layer, so I created a new bottom layer called "Limbo" and made it invisible. Now when I switch layouts I don't have to worry about the globals showing up in places they shouldn't, and I can grab the ones from "Limbo" as needed. It's a pretty simple fix.

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