How do I test 2 sprites image points?

0 favourites
  • 3 posts
From the Asset Store
Soldier Test
$9.99 USD
A Construct version 2 & 3 "Stand-alone" RPG game with "In-Game Module" (IGM) integration.
  • Hello.

    I have two sprites and want to test when the first sprite's image point 8 (in other words only a specific image point) touches any of the second sprite's image points. Is this possible?

    Thanks very much in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • First check this out in system conditions

    Compare two values

    Compare any two expressions (which can either numbers or text) with each other. They can be compared as Equal, Not equal, Less, Less or equal, Greater or Greater or equal.

    and now this in sprite expressions

    ImagePointX

    ImagePointY

    Retrieve the position of an image point on the currently displaying animation frame of the object. You can pass either the zero-based index of the image point, or a string of its name.

  • Excellent. Thank you. I think I've got it now. I almost posted a reply to myself to "read the manual"

    So the event sheet looks like this:

    System int(Player.ImagePointX("Nose") = int(Asteroid.ImagePointX(2)) <-- this just tests the "Nose" of my Player with an Asteroid which is rotating 1 degree per system tick.

    And, also demonstrates granpa's explanation above using a string name for the first sprite image point and a numeric value for the second sprite image point.

    Once I have the the 2 image points in the x-axis equal I can kick off any number of actions! Additionally, I can now add in the y-axis for a precise "connect point".

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