How do I check if an image point or coordinate has a certain object under it?

0 favourites
  • 5 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • I'm trying to do some point based collision and was wondering if there is a way to quickly check if 4 specific coordinate points have a sprite under it. For example, I have the point 400, 800, and want to check if that point overlaps a specific object.

    You could do this in code, obviously, but for efficiency's sake I am looking for a built in way.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is no "Is overlapping point" condition. However, you could probably create a single pixel collision "polygon" and do your test with this object. A caveat is that you need to move this object for every check you want to do.

  • Yes, that was one of my ideas but I wanted to avoid a solution which used a lot of coding, since I need to do it 4 times for 4 points (to check if an object is fully overlapped by another object) so I'll probably end up making a custom function or expression. Thanks for the reply!

  • There is no "Is overlapping point" condition.

    Actually, there is - "System pick overlapping point".

    Variable counter=0
    Repeat 4 times
     System pick Box overlapping point (Sprite.ImagePointX("Point"&loopindex), Sprite.ImagePointY("Point"&loopindex))
     	Add 1 to counter
    
    If counter=4 
    	Set text "All 4 boxes are correctly placed"
    
  • Weird that such a feature is under "System" and not a common condition like many other.

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