Using layout for levels

This forum is currently in read-only mode.
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • How would I go about creating a second level with a second layout without using global objects? I was under the impression that instead of recreating the sprite for every layout, I can just set it to global. When I did that, the objects on one layout didn't delete when going to the next.

    Can I just copy and paste an object from one layout to another without setting it as a global object? Would it still be the same object or will it be separate where if I wanted to make a, for example, behavior change, I'd have to change it on every layout the object is on?

    Any help appreciated!

  • Yes, that's the better method for visible objects (like players), just copy/paste them over. It won't create a new Sprite, just a new instance.

  • Yes, that's the better method for visible objects (like players), just copy/paste them over. It won't create a new Sprite, just a new instance.

    Oh okay. Though I just did that and some things seem to be acting strangely. The player sprite is moving thrice as fast but I'm still using the same event sheets...

    Well, thanks for the help!

  • That's very strange; all I can think is the behavior properties or something didn't transfer properly.. check them over incase that happened .

  • > Yes, that's the better method for visible objects (like players), just copy/paste them over. It won't create a new Sprite, just a new instance.

    >

    Oh okay. Though I just did that and some things seem to be acting strangely. The player sprite is moving thrice as fast but I'm still using the same event sheets...

    Well, thanks for the help!

    I had that before. Pretty sure your player sprite isn't on the right layer then.

  • I had that before. Pretty sure your player sprite isn't on the right layer then.

    The player sprite is on the first layer of each layout.

    I just did a test and it seems that on the second layout the player moves twice as fast and on the third it moves thrice as fast. Maybe the MouseKeyboard object is adding up on each additional layout instead of acting as an instance? Maybe it being a custom moving and jumping system has something to do with it too?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • All non-global objects are destroyed at the end of a layout, so it works exactly the same in the events as using global objects, except nothing from the previous layout is left over. If you do have global objects like Mouse & keyboard though, make sure those don't get copied, otherwise you end up with 2 global instances.

    This sounds most likely to be a problem in your own events, unless you can reproduce it in a fresh .cap.

  • This sounds most likely to be a problem in your own events, unless you can reproduce it in a fresh .cap.

    *facepalm*

    Okay, I just found out the problem. In the additional layouts I was including four event sheets, but one of them already had three of those event sheets included, meaning it was running them twice... such a stupid mistake on my part!

    Thanks for all the help.

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