Skip to content

Instantly share code, notes, and snippets.

@ryanflorence
Created May 12, 2010 18:57
Show Gist options
  • Save ryanflorence/398991 to your computer and use it in GitHub Desktop.
Save ryanflorence/398991 to your computer and use it in GitHub Desktop.
var Warrior = new Class({
energy: 100,
kills: 0,
attack: function(target){
if (target.energy < this.energy){
target.isAlive = false;
this.kills++;
}
this.energy = this.energy - 5;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment