phy_collision_points

This read-only variable returns the number of points of collision detected between the two instances in the collision.

The number returned by this function is the number of items in the built-in phy_collision_xphy_collision_yphy_col_normal_x and phy_col_normal_y arrays in the current collision event.

NOTE This variable is only available in the collision event of a physics-enabled instance.

 

语法:

phy_collision_points

 

返回:

Real (integer value, or undefined if the instance doesn't have physics enabled)

 

例子:

Collision Event

for(var i = 0; i < phy_collision_points; i += 1;)
{
    part_particles_create(global.Sname, phy_collision_x[i], phy_collision_y[i], global.Spark, 5);
}

The above code creates particles at all the defined points of a collision between two physics-enabled instances.