How to make classes with properties for characters?

0 votes
asked Nov 28, 2017 by RedeemingEndevor (120 points)
I am trying to make characters in a game but I am having trouble, because I can't make characters as a class. I want to be able to make characters as a class so that I can make object based stats.

I was thinking about something like the code bellow, but my problem is I don't know how to call the constructor. I don't know how to interact with the classes correctly and how to get or set the variables. I  have only started using this software a few days ago.

class Character{
constructor(Wisdom,Strength, Constitution, Charisma, Dexterity, Intelligence){
this.Wisdom = Wisdom;
this.Strength = Strength;
this.Constitution = Constitution;
this.Charisma = Charisma;
this.Dexterity = Dexterity;
this.Intelligence = Intelligence;
}}

Character mainCharacter = new Character($Wisdom, $Strength, $Constitution, $Charisma, $Dexterity, $Intelligence);

1 Answer

0 votes
answered Nov 28, 2017 by greyelf (88,790 points)

The Classes documentation on the MDN site may help you, however it should be noted that the class feature is not equally supported by all the major brands of web-browser in particular Internet Explorer. 

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...