-
Notifications
You must be signed in to change notification settings - Fork 0
raycast_check
Rodrigo Gómez Maitret edited this page Sep 1, 2020
·
1 revision
Checks if there is a specific object colliding with the line formed by two points.
raycast_check(x1, y1, x2, y2, obj, qua)
Parameter | Description |
---|---|
x1 | Point A's X. |
y1 | Point A's Y. |
x2 | Point B's X. |
y2 | Point B's Y. |
obj | The object you're looking a collision for. |
qua | The quality of the check (0-1). The higher the slower. |
Returns: Boolean
if (raycast_check(room_width/2, 0, room_width/2, room_height, obj_player, 1))
{
show_message("I see you!");
}
The code above will display a message if obj_player touches the horizontal center of the room.
PoshoLib / Posho_Raycast / raycast_check