User Tools

Site Tools


al:liveactor

This is an old revision of the document!


al::LiveActor

LiveActor is a class that represents an actor in a scene1). This can be an enemy, level geometry, or anything in between. Most inherited classes use the Nerve system to distribute code to different functions, instead of just 1 update function.

Alive & Dead

StageScene uses its camera and other factors to determine if a LiveActor is currently “alive” or “dead”, alive meaning its code is being run, dead meaning it is not. For StageScene actors that are not on screen are dead, which benefits performance.

Functions

init

This function takes an ActorInitInfo parameter with the BYML node this actor is being created from in the stage file. It is used by inherited classes to initialize the Nerve system and the actor itself.

makeActorAlive & makeActorDead

These functions manually make the actor alive/dead.

movement

This is the internal “update” function for LiveActor. It updates all “Keepers” (NerveKeeper, etc.), and calls control.

control

This function is called every frame if the actor is alive.

1)
usually StageScene or DemoScene
al/liveactor.1647525007.txt.gz · Last modified: 2022/03/17 13:50 by fruityloops