-
Notifications
You must be signed in to change notification settings - Fork 0
raycast_coord
Rodrigo Gómez Maitret edited this page Sep 1, 2020
·
1 revision
Checks if there's a collision between two points and returns coordinates.
raycast_coord(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: Array
Array values:
Index | Coord. |
---|---|
0 | x |
1 | y |
var pos = raycast_check(room_width/2, 0, room_width/2, room_height, obj_player, 1);
show_message("Found you at "+string(pos[0])+", "+string(pos[1])+"!");
The code above will display a message containing the coordinates where the obj_player is colliding with a line.
PoshoLib / Posho_Raycast / raycast_coord