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...

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...
 Share

  • Recently Browsing   0 members

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