Last active
August 29, 2015 14:15
-
-
Save victorvhpg/038d6cd2537293ffb3f1 to your computer and use it in GitHub Desktop.
usando modulo Poder.js
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
"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