API Reference › IVec2 › IVec2.heading
method

IVec2.heading

IVec2.heading(from, to) -> int

The angle from from to to in whole degrees: 0 is +x, 90 is +y (screen y grows downward). Pair it with Angle.diff_degrees for an arc test.

Example

# doc-check: skip — illustrative
let to_foe = IVec2.heading(hero, foe)
← All symbols