Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created April 14, 2019 22:22
Show Gist options
  • Select an option

  • Save iskenxan/d43703ca3ac28ad29d3192b1fa05f705 to your computer and use it in GitHub Desktop.

Select an option

Save iskenxan/d43703ca3ac28ad29d3192b1fa05f705 to your computer and use it in GitHub Desktop.
const Flying = stampit(Character, {
methods: {
fly() {
console.log(`${this.name} takes off in the sky!`)
stamina --;
}
}
});
const SuperStrength = stampit(Character, {
methods: {
init({ stamina = this.stamina }) {
this.stamina = stamina
},
throwBoulder() {
console.log(`${this.name} throws a huge rock at the enemy!`)
stamina -= 2;
}
}
});
const Intelligence = stampit(Character, {
methods: {
useGadget() {
console.log(`${this.name} shoots a DIY lazer gun!`)
}
}
});
const MartialArts = stampit(Character, {
MartialArts: {
throwBoulder() {
console.log(`${this.name} does a 'Flying Dragon' kick!`)
stamina -= 3;
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment