Skip to content

Instantly share code, notes, and snippets.

@victorvhpg
Last active August 29, 2015 14:15
Show Gist options
  • Save victorvhpg/038d6cd2537293ffb3f1 to your computer and use it in GitHub Desktop.
Save victorvhpg/038d6cd2537293ffb3f1 to your computer and use it in GitHub Desktop.
usando modulo Poder.js
"use strict";
//dependencias do modulo
var Poder = require("./Poder");
var Personagem = function(n) {
this.nome = n;
this.poder = new Poder("normal");
};
Personagem.prototype = {
constructor: Personagem,
soltarPoder: function() {
this.poder.soltarPoder();
},
falar: function(msg) {
console.log("[" + this.nome + "]: " + msg);
}
};
//exportando o constructor Personagem
module.exports = Personagem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment