Pick by comparison vs Pick by evaluate

0 favourites
  • 2 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hello everyone!

    Recently I needed in the project select items on the condition: distance (x1, y1, x2, y2) <z.

    For this purpose, suitable functions Pick by comparison and Pick by evaluate.

    So I have questions:

    1. What is the best to use, Pick by comparison or Pick by evaluate?

    2. What is the difference between them, except that in the Pick by evaluate, you can specify multiple test conditions?

    3. In what function the best performance?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pick by comparison picks when the expression meets a value (value = expression, expression = value)

    Pick by evaluate picks when the expression returns a true (boolean), or a 1.

    Pick by evaluate wil not pick when the expression returns a false (boolean) or a zero.

    Wich one to use ? In fact they are the same, just differend ways of inputting the expression/values/evaluaters. Besides that the Pick by evaluate can also handle OR's, well any expression that returns a false/true or a 0/1.

    Example. Pick by comparison with a expression : sprite.x and a value 500 and the evaluator "<" is exactly the same as a Pick by evaluate with an expression : sprite.x < 500 (returns true when met, false when not)

    But Pick by evaluate can do much more, see example in the manual:

    Object.X > 100 & Object.Y > 100) | (Object.X < -100 & Object.Y < -100

    | means OR. & means AND

    But Pick by evaluate can also test instance variables in the form of a boolean.

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