-
-
Notifications
You must be signed in to change notification settings - Fork 18
line_get_slope
Vašek edited this page Feb 7, 2019
·
3 revisions
Returns the slope of the given line
line_get_slope(pos1, pos2)
Argument | Description |
---|---|
Vector2 pos1 | First position of the line |
Vector2 pos2 | The other position of the line |
Returns: float
A slope is a number that describes steepness of the line. The slope is calculated by dividing the difference in y-coordinates by the difference in x-coordinates. For example:
image_angle = choose(0, 90, 180, 270);
This code will set an object's image_angle to one of four angles (in this case 0, 90, 180, or 270 degrees) on random when the event is called.
Back to number_functions