strol

The best practices for using es6 constructor?

Recommended Posts

  1. What can we do in our constructor and what we can’t?
  2. The difference between constructor and ‘create’ method?
  3. What we must put to the constructor and what to the ‘create’ method?
  4. How do you use the constructor in your code?

Now I am using constructor when I want to get a scene in the derived class and then I use this scene to create new objects and move all ‘this.’ initialization from ‘create’ method to constructor because 80% depends on the received scene. So the ‘create’ method becomes useless and empty. Maybe I do something wrong.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.