Jump to content

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


mattasaurus
 Share

Recommended Posts

In the Phaser 3 examples we have an example extending Phaser.Scene like so (http://labs.phaser.io/edit.html?src=src\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)?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...