Referencing a dynamic instance that is the same

0 favourites
  • 6 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • <img src="http://i.imgur.com/HhOxs8I.jpg" border="0">

    I need to modify Z orders so that the object the arrow is pointing to is higher than the object to its left.

    <img src="http://i.imgur.com/fxIopss.jpg" border="0">

    I'm trying to reference using the family (as I'm not sure doing an 'is overlapping seekerpart' would reference another seekerpart and not itself).

    Anyone have an idea on how this would be accomplished without creating another object?

    Here's the .capx, but it's kind of big so I isolated the relevant parts in the images above.

    BoardGame.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Tagging vee41 because he knows how to solve all my problems :D

  • Here's an update.

    The problem:

    <img src="http://i.imgur.com/OXNcgIX.jpg" border="0" />

    To the bottom-right, you'll see there is a number 0. This is debug text that is supposed to equal the UID of the pink part that needs Z-level correction:

    <img src="http://i.imgur.com/HhOxs8I.jpg" border="0" />

    Here is what the current set of events is:

    <img src="http://i.imgur.com/0EkG4MF.jpg" border="0" />

    My goal is to be able to pick the problem part so I can change its Z order. As you can see by the "0" number near the bottom right of the first image, the problem part isn't being picked. Does anyone know how to pick the problem part?

  • I tried doing an ordered For Each loop to pick by highest IID and where the animation frame is equal to facing left, but that doesn't seem to work either (the variable that should be equal to the picked part's UID is still 0).

    Any help on this is appreciated. Now requesting help from R0J0hound :D

  • Z order is the order objects are placed on top of each other.

    Think of it as you would layers, or layers of glass where the sprites are simply decals placed on that glass.

    So if objects are not over one another they are visible.

    Objects created at runtime are automatically placed at the top.

    Perhaps you should take a look at that frames hot spot instead.

  • You could just sort all the pieces at once. It's not as concise as only sorting the relevant pieces but it sure is simpler to implement and debug.

    For each seekerPart ordered by seekerPart.x*10000+seekerPart.y

    --- seekerpart send to front

    The 10000 is just an arbitrary number larger than the layout height.

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