]> git.r.bdr.sh - rbdr/serpentity/blame - lib/serpentity/system.js
Merge branch 'release/3.0.0'
[rbdr/serpentity] / lib / serpentity / system.js
CommitLineData
85861d67
BB
1/*
2 * Systems contain most of the logic, and work with nodes in order to
3 * act and change their values.
4 *
5 * You usually want to inherit from this class and override the
d0eb71f3 6 * three methods. They are shown here to document the interface.
85861d67 7 */
85861d67 8
19e91cdd 9export class System {
d0eb71f3
BB
10
11 /*
12 * This will be run when the system is added to the engine
13 */
b3b840f8 14 added() {
d0eb71f3
BB
15 // Override with added(engine)
16 // Receives an instance of the serpentity engine
17 }
18
19 /*
20 * This will be run when the system is removed from the engine
21 */
b3b840f8 22 removed() {
d0eb71f3
BB
23 // Override with removed(engine)
24 // Receives an instance of the serpentity engine
25 }
85861d67 26
d0eb71f3
BB
27 /*
28 * This will run every time the engine's update method is called
29 */
b3b840f8 30 update() {
d0eb71f3
BB
31 // Override with update(dt)
32 // Receives a delta of the time
33 }
19e91cdd 34}