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