var darkVador = {
race: 'human',
job: 'villain',
talk: function() {
return 'come to the dark side, Luke!' + this.breathe();
},
describeYourself: function() {
return "I'm a " + this.race + " and I'm a " + this.job + " in a series of movies!" + this.breathe();
},
breathe() {
return ".....shhhhhhhhh.....";
}
}
function dvSpeak() {
document.body.innerHTML += '<p>Dark Vador describes himself: ' + darkVador.describeYourself(); + '</p>'; document.body.innerHTML += '<p>Dark Vador says: ' + darkVador.talk(); + '</p>';
}
JS.Object.GameDesignwObjects.ex3
--------------------------------
A [Pen](https://codepen.io/Onlyforbopi/pen/dqxNyq) by [Pan Doul](https://codepen.io/Onlyforbopi) on [CodePen](https://codepen.io).
[License](https://codepen.io/Onlyforbopi/pen/dqxNyq/license).