-
Notifications
You must be signed in to change notification settings - Fork 5
Behaviors
D.R.Y
In brief a Behavior
is an isolated block of code that
gives an object some abilities like bounce, jump, 4-way move.
Every behavior works as its own, may or may not combine with others.
The pure ECS style can be very performant, systems are some pure functions which brings robust logic. The problem is that you need to manage entities and components manually, and usually such a system is hard to design and code. Which is not even a problem for serious projects but takes time and requires higher level skill of developers.
This kind of thing already exists in LesserPanda, they are called Systems
.
They are responsible to the most important parts like "graphics",
"physics", "timer" and "animation".
While a behavior can be self-contained, that does not require external steps
to work, simply call behave
and you are ready to go.
- Behaviors should inherit
Behavior
interface - Every behavior should have a unique
type
property - It may provides some methods as
actions
- Enable
canEverTick
orcanFixedTick
of entities to be able to get behavior itself updated