Jump to content

Installing components in Phaser 2.3.0


mafcho
 Share

Recommended Posts

Hello,
 
I'd like to add the Health component back to my Sprite subclass now that I've upgraded to 2.3.0.  Looking at Sprite's source, it uses Phaser.Component.Core.install to do that.  But according to the docs for the install method, it's internal and shouldn't be used directly... so what is the intended way to add a component in 2.3.0?

 

Thanks,

Matt

Link to comment
Share on other sites

Hi Rich,

 

Maybe health got left out by mistake then?  Even on a normal sprite object I can't use damage().  When I look at sprite's src in https://github.com/photonstorm/phaser/blob/master/src/gameobjects/Sprite.js I'm not seeing the health component getting added:

Phaser.Component.Core.install.call(Phaser.Sprite.prototype, [    'Angle',    'Animation',    'AutoCull',    'Bounds',    'BringToTop',    'Crop',    'Delta',    'Destroy',    'FixedToCamera',    'InputEnabled',    'InWorld',    'LifeSpan',    'LoadTexture',    'Overlap',    'PhysicsBody',    'Reset',    'ScaleMinMax',    'Smoothed']);

Thanks,

Matt

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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