Difference between revisions of "Behavior Class"
From Heroes of Hammerwatch wiki
(Created page with "Behavior classes can be any class referenced from a unit's behavior tag. ==Methods called from the engine== The engine calls the following functions, if they exist: * <code>...") |
|||
| Line 1: | Line 1: | ||
Behavior classes can be any class referenced from a unit's behavior tag. | Behavior classes can be any class referenced from a unit's behavior tag. | ||
| + | |||
| + | Objects are constructed using this constructor: | ||
| + | |||
| + | ClassName(UnitPtr unit, SValue& params) | ||
==Methods called from the engine== | ==Methods called from the engine== | ||
Latest revision as of 13:37, 19 June 2019
Behavior classes can be any class referenced from a unit's behavior tag.
Objects are constructed using this constructor:
ClassName(UnitPtr unit, SValue& params)
Methods called from the engine
The engine calls the following functions, if they exist:
void Update(int dt)void QueuedPathfind(array<vec2>@ path)void QueuedFetchActors(array<UnitPtr>@ actors)void Collide(UnitPtr unit, vec2 pos, vec2 normal)void Collide(UnitPtr unit, vec2 pos, vec2 normal, Fixture@ fxSelf, Fixture@ fxOther)void EndCollision(UnitPtr unit)void EndCollision(UnitPtr unit, Fixture@ fxSelf, Fixture@ fxOther)void Destroyed()vec4 GetOverlayColor()SValue@ Save()void Load(SValue@ save)void PostLoad(SValue@ save)