Skip to content

raycast_check

Rodrigo Gómez Maitret edited this page Sep 1, 2020 · 1 revision

Description

Checks if there is a specific object colliding with the line formed by two points.

Syntax

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

Example

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.

Map

PoshoLib / Posho_Raycast / raycast_check

Functions
Objects
Simplifications
Macros
Clone this wiki locally