Epok Engine

EPOK RUNTIME

epok::CharacterBody2DComponent::move_and_collide

Method · 1 overload

Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.

Method

Moves by an explicit displacement (pixels) and stops at the first obstacle.

Belongs to
epok::CharacterBody2DComponent
Header
world2d_components.hpp
Overloads
1

Declaration

Declaration
bool move_and_collide(Fixed dx, Fixed dy)

Moves by an explicit displacement (pixels) and stops at the first obstacle.

ParameterTypeMeaning
dxFixedNot documented; consult the linked header.
dyFixedNot documented; consult the linked header.

Returns: bool. Consult the linked header for its meaning.

Example sketch

C++ example
#include "world2d_components.hpp"

// Assume these named values have been initialized with valid data:
// Fixed dx
// Fixed dy

epok::CharacterBody2DComponent& object = /* obtain a valid instance */;

auto result = object.move_and_collide(dx, dy);

Trade-offs and warnings

Consult the linked header for this operation’s ownership, lifetime and failure behavior.

Declared in runtime/world2d_components.hpp:490

Related members