physics_test_overlap

Checks for an overlap of two fixtures at a given position.

Syntax:

GML Code Example

physics_test_overlap(xpos, ypos, angle, obj);


Argument Description
xpos The x position in the room to check
ypos The y position in the room to check
angle The angle to check (of the calling instance)
obj The object to check for


Returns: Boolean.


Description

This function can be used to check and see if a physical body (ie: the fixture of an instance) overlaps, or will overlap, when rotated and placed at a given position in the room. the "angle" argument is the angle of rotation that the calling instance has (or will have) at the position to be checked, and the "obj" argument can be either a single instance id, and object index or the keywords all or other.


Example:

GML Code Example

if physics_test_overlap(x+20, y-35, 0, obj_Bomb)
    {
    alarm[0] = room_speed;
    ignited = true;
    }
 

The above code will check a position for a physics fixture overlap, and if there is one, it sets a variable and an alarm.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here