How do I pick min or max value from multiple instances

Not favoritedFavorited Favorited 0 favourites
  • 7 posts
From the Asset Store
10 Traditional Soundtracks / ~2 mins each / 22 mins of Tavern Music
  • I have a player and a box

    i did copy box several time in layout and scattered them in layout

    Now I want to compare Player's "Y" position with very top box and very bottom box

    when player is equals to very Top Box's "Y" position

    when player is equals to very Bottom Box's "Y" Position

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here are two ways to do this:

    To pick bottom box, replace order to "descending" in event1, or condition to ">=" in event 4.

    if all boxes are at the same X, you can use "Box pick nearest/furthest" event.

  • Hi dop2000

    Do you know ?

    How do i identify sequence appearance of Boxes

    Suppose Boxes are scattered in layout

    Now I want to Identify from left to right

    which box comes first then second then third and so on

  • See my previous comment, method #1:

    For each Box order by Box.x ....

    You can add an instance variable "orderNumber" and set it in this For each loop.

  • that one was for comparing player's position with very top and very bottom box

    But this question is not related to that

    This is different Question and I'm here not comparing with player

    here only boxes are scattered in layout and a variable added to Box

    and I only want to Identify their appearance No. from left to right and put their order of appearance to that variable.

  • that one was for comparing player's position with very top and very bottom box

    But this question is not related to that

    This is different Question and I'm here not comparing with player

    here only boxes are scattered in layout and a variable added to Box

    and I only want to Identify their appearance No. from left to right and put their order of appearance to that variable.

    luckyrawatlucky

    dop2000 already gave you the Answer is exactly the same Thing, just remove the comparison against the Player, The for Each order will short out the Condition that you enter there to compare in this case is by (X)

    Capx: https://www.dropbox.com/s/56enru0ye9n1bvb/For%20Each%20Order%20by%20spriteX.capx?dl=0

  • Thank you both

    this is exact what i want

    thanks again

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