How do I re-use sprites on other layers?

0 favourites
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Okay, so the title isn't as explanitory... But I want to use the same sprites for p1 and p2 on other layers (layers 1-10x)... As players 1 and 2 overlap another object, it is essentially a "level goal" and it triggers the next level... If that makes sense... Any help figuring this out would be awesome!

  • That didn't make much sense... Basically...

    Lvl1:

    P1 and P2 move around and once both players are overlapping their designated goal spots, we'll call them Goal1 and Goal2... It loads the next level.

    Once the new level is loaded, I have P1 and P2 again, looking for their designated G1 and G2 spots. Once overlapping, I want to load the next level... Problem being, it doesn't seem to work...

    I'm using ONE event sheet. 2 groups Lvl1 and 2... The events are identical...

    I know this is incorrect, I just can't figure out how to solve for this... Hope it makes sense.. Thanks!

  • Please share your capx, because your explanation is hard to follow without it.

    Having two groups with exactly the same events seems like a waste of space.

  • LittleStain - How can I share it with you? should I throw all of my files onto a server and send a link?

  • chrimbus You need to save your project as single *capx file and upload it somewhere. Most of us here are using dropbox cause it's fast and easy way of sharing project files.

    Edit: Yep, You just basically did that while I was writing this post. Nevermind then ;)

  • shinkan - thanks! sorry, i should have used my brain before asking that question... :D

  • Fixed .capx

    What you did is a loop. If you want to use one event sheet for multiple layouts like you did, You need to specify on what layout you currently are and where you want to go.

  • Can you be more specific? I'm not sure I follow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sure. You have one event sheet for all layouts. This event sheet is doing only one thing

    object is overlapping different object -> go to level 2

    object is overlapping different object -> go to level 3

    This is that loop I was talking about.

    Every time you enter a layout - doesn't matter which one, You will always go to level 2. Because this is your very firs event.

    To avoid that I'v inserted a simple condition to compare on what level you currently are.

    If you are on level 1

    object is overlapping different object -> go to level 2

    If you are on level 2

    object is overlapping different object -> go to level 3

  • Weird, for me, on lvl 1, after walking thru the doors, it goes to lvl 2, but it isn't going to lvl3 next.... So I don't understand how to solve for that. Sorry if this is confusing, I'm new to this :)

  • No worries.

    What you saying is and will be true.

    Look again on your events

    1. object is overlapping different object -> go to level 2

    2. object is overlapping different object -> go to level 3

    Events always run from top to bottom.

    If you start game on level 1 you will go to level 2,

    If you start on level 2 you will go to level 2

    if you start on level 3 you will go to level 2

    and so on...

    Basically your events are saying "no matter what" always go to level 2

    It's happening because that's the way how events work.

    "2. object is overlapping different object -> go to level 3"

    This event will never be active and you will never go to level 3 because before that you are going to level 2.

    Like I said before, you need to specify on what level you are and where you want to go next.

    You could do that very easily with global variable.

  • How would I do that with a global variable?

  • Here you go

    I've added one more event 'On start of layout" to check on what layout you currently are and to set global variable with appropriate level number, so you can test your game from any level and go to next one without changing global variable.

  • I have version 158.2, looks like you are running 1.6 (a paid version I assume?)...

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