Sha256: bd1c3b8c006c1ca845fe57bcc726e22018ed1bb6612dc78151c6bb7a9fad9374
Contents?: true
Size: 481 Bytes
Versions: 9
Compression:
Stored size: 481 Bytes
Contents
/** * class Character < Jax.Model * */ var Character = (function() { return Jax.Model.create({ after_initialize: function() { this.setPosition(0, 0, 0); }, /* other Character-specific logic */ attack: function(target) { target.takeDamage(this.damage); }, takeDamage: function(amount) { this.hit_points -= amount; if (this.hit_points <= 0) { throw new Error("Character "+this.name+" died!"); } } }); })();
Version data entries
9 entries across 9 versions & 1 rubygems