]>
Commit | Line | Data |
---|---|---|
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 | |
6 | * three methods. They are shown here to document the interface. | |
7 | */ | |
8 | ||
9 | export class System { | |
10 | ||
11 | /* | |
12 | * This will be run when the system is added to the engine | |
13 | */ | |
14 | added() { | |
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 | */ | |
22 | removed() { | |
23 | // Override with removed(engine) | |
24 | // Receives an instance of the serpentity engine | |
25 | } | |
26 | ||
27 | /* | |
28 | * This will run every time the engine's update method is called | |
29 | */ | |
30 | update() { | |
31 | // Override with update(dt) | |
32 | // Receives a delta of the time | |
33 | } | |
34 | } |