Created
November 30, 2012 20:26
-
-
Save richtaur/4178364 to your computer and use it in GitHub Desktop.
A component in Djinn's entity/component system.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define({ | |
id: "regenerator", | |
conf: { | |
amount: 1, | |
elapsed: 0, | |
interval: 1000 | |
}, | |
update: function (dt) { | |
var conf = this.conf; | |
conf.elapsed += dt; | |
if (conf.elapsed >= conf.interval) { | |
conf.elapsed = 0; | |
this.callComponents("heal", [conf.amount]); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment