Extending Phaser classes: ES6 syntax vs Phaser.Class: differences?

Recommended Posts

In the Phaser 3 examples we have an example extending Phaser.Scene like so (\scenes\scene from class.js):

var MyScene = new Phaser.Class({

    Extends: Phaser.Scene,

    // [...]

using ES6 we might say instead:

class MyScene extends Phaser.Scene {

From what I see, I think that these are functionally very similar. But I could easily have missed or misunderstood something.

Are these the same in effect (or almost the same)? If there are differences, what are the significant differences? Is one preferred over the other (assuming ES6 is an option)?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.