Jump to content

Phaser and Ooop !


Codenburger
 Share

Recommended Posts

Hi,

 

I am new to Phaser and I am going to be using JavaScript, coming from a Python background, using Oop !

 

May I ask, is Oop generally using with Phaser and JavaScript.

 

Would Oop be a good way to create games with Phaser and JavaScript.

 

This looks like a great Game engine. I can't wait to get stuck in.

 

Codenburger

Link to comment
Share on other sites

OOP is probably the only way to create something bigger than a simple demo scene. Example of a Sprite object in Javascript https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/views/SpriteAnimated.js and example controller https://github.com/UgnisSoftware/Phaser-Starter-Kit/blob/master/public/javascripts/states/example/exampleController.js.

In reallity, code usually doesn't look that clean, this is how controller usually looks in reallity: https://github.com/UgnisSoftware/The-Lone-Wolf-Corp./blob/master/public/javascripts/states/space/SpaceController.js but the same OOP principles apply.

Also, you should probably give TypeScript a try, it makes OOP much cleaner and Phaser fully supports it.

Link to comment
Share on other sites

  • 3 months later...
 Share

  • Recently Browsing   0 members

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