Full mask collision using code.

J

James Korsean

Guest
Is there a way I can use code, not the events, to detect if two objects collide? And please, please for gods sake don't tell me "place_meeting". That object uses the object X and Y and not the whole object sprite mask which is what I need. How can I accomplish this?
 

YoSniper

Member
Well, I know you don't want to hear it, but place_meeting IS your best code representation.

The x and y arguments are used to establish relative placement. The program isn't looking at just the one point to determine if a collision is happening; it actually places the object's collision mask at that location and then determines if there is a collision.

But if you are dead seat on not using place_meeting, you could instead use functions like collision_line, collision_rectangle, collision_circle, and the like. Those functions look for collisions in specific regions regardless of the object's collision mask and location. The "other" keyword is also not nearly as reliable when used in such situations.
 
J

James Korsean

Guest
Ahhhhhh, I thought the "place_meeting" was just a single point, not the mask position. Thanks!
 
Top