Stuck

Category: Objects / Status
Since engine version: 8.0 OC

Description

Returns whether the object is stuck, meaning that one of its vertices is enclosed in solid matter. An optional offset can be specified, in which case it is checked whether the object would be stuck at the offset position.

Syntax

bool Stuck(int x, int y);

Parameters

x:
[opt] X offset for which stuck-status is checked.
y:
[opt] Y offset for which stuck-status is checked.

Examples

if(GetCursor()->Stuck()) GetCursor()->Message("Help!");
Displays a message above the selected clonk of the first player if the clonk is stuck at the time the script is called.
if(GetCursor()->Stuck() && !GetCursor()->Stuck(0, -10)) GetCursor()->SetPosition(GetCursor()->GetX(), GetCursor()->GetY() - 10);
If the clonk is stuck at its current position but would not be stuck 10 pixels higher, move it upwards.
See also: GetContact, GetMaterial, GetVertex, Unstick, VerticesStuck
Sven2, 2016-09