-
Notifications
You must be signed in to change notification settings - Fork 0
Collision_line
hugh greene edited this page Jun 20, 2022
·
1 revision
General description of the function.
- x1: (x1,y1) first point of the line
- y1
- x2: (x2,y2) second point of the line
- y2
- obj: object type index, to check the collision of all instances of the object
- prec: whether to use precise perpixel collision checking
- notme: whether or not the object calling the function should be checked for collision with the line
bool: Returns (true or false) whether or not there is a collision.
// demonstrates checking for a collision between two objects for another object
if (collision_line(obj_player.x, obj_player.y, obj_enemy.x, obj_enemy.y, obj_wall, false, false) != noone) {
// there was a collision with a wall between the player's position and the enemy's
} else {
// there was no collision
}
NOTOC
edited by hpg678 on Github