enum

PointClickEngine::Characters::Direction8

Inherits Enum < Comparable < Value < Object

8-directional movement for adventure games

Constants

North = 0
NorthEast = 1
East = 2
SouthEast = 3
South = 4
SouthWest = 5
West = 6
NorthWest = 7

Constructors

from_velocity(velocity : RL::Vector2) : Direction8

Convert from velocity vector to direction

Source

Instance methods

angle_difference(other : Direction8) : Float32

Calculate angle difference for turn animations

Source
east?

Returns true if this enum value equals East

Source
north?

Returns true if this enum value equals North

Source
north_east?

Returns true if this enum value equals NorthEast

Source
north_west?

Returns true if this enum value equals NorthWest

Source
opposite

Get opposite direction for turn animations

Source
south?

Returns true if this enum value equals South

Source
south_east?

Returns true if this enum value equals SouthEast

Source
south_west?

Returns true if this enum value equals SouthWest

Source
west?

Returns true if this enum value equals West

Source