Skip to content

StrafeAction ​

Inherits: CombatAction < Resource

StrafeAction circles around the target while maintaining facing direction. Useful for action RPG enemies that position tactically.

Properties ​

intstrafe_direction1
floatmaintain_distance5.0
floatstrafe_arc_degrees90.0
boolshould_walkfalse
floatstrafe_duration0.0

Variables ​

floatstrafe_start_time0.0
boolis_strafingfalse

Methods ​

boolis_strafe_complete( entity: Entity )
voidreset()

Property descriptions ​

int strafe_direction = 1 ​

Strafe direction (1 = right/clockwise, -1 = left/counter-clockwise)

float maintain_distance = 5.0 ​

Distance to maintain from target

float strafe_arc_degrees = 90.0 ​

Arc angle to strafe (degrees) - how far to circle

bool should_walk = false ​

Whether to walk (true) or run (false)

float strafe_duration = 0.0 ​

Duration to strafe (seconds) - if 0, goes until arc complete

Variable descriptions ​

float strafe_start_time = 0.0 ​

Internal tracking

bool is_strafing = false ​

True while the entity circles its target.

Method descriptions ​

bool is_strafe_complete( entity: Entity ) ​

Check if strafe is complete (used by tactical logic)

void reset() ​

Reset for next use