Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Improvements on the API


endel
 Share

Recommended Posts

First of all, congrats for your job and effort on this awesome framework.
This question is more a conceptual thing than a question in fact.
 
There are some functions on Phaser framework that maybe better defined on other scope.
 
Examples:
- physics.angleBetween - the first argument is a Sprite. Shouldn't this method be called from `sprite.angleBetween` ?
- physics.distanceBetween - same as above.
 
Maybe the loader should support chaining. So preloads will look like this:
game.load.image(...)  .image(...)  .spritesheet(...)  // so on...

I'm just getting started with Phaser framework, and I'm really interested to contribute on whatever I'm able to help.

 

Link to comment
Share on other sites

Thanks for checking Phaser out. I really don't want Sprite to become a "super class" and it's already dangerously close to that. So anything that can sensibly be contained together (such as angle/velocity modifications to physics) are most likely going to be kept that way really.

 

Personally I'm not a fan of that chaining style, but I know lots of people are used to it from jQuery, so I have modified the Loader class so all of the data type functions (image, audio, etc) now 'return this' at the end of them, so you can chain them together if you so desire. This is part of the dev branch in github (or at least will be when I do a new push later on tonight).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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