Faizy Posted April 19, 2017 Share Posted April 19, 2017 Let´s say I want an hp bar over the enemy. Is it possible to bind the hp bar to the enem? So that it moves whereever the enemy is moving? Sure, I could realise this by saying the following in the update function: hpbar.image.x = enemy.image.x hpbar.image.y = enemy.image.y But is there another way? Link to comment Share on other sites More sharing options...
snowbillr Posted April 19, 2017 Share Posted April 19, 2017 Sure is! Just use the `addChild` http://devdocs.io/phaser/phaser.sprite method for the sprite. You can add the hpbar as a child sprite to the enemy. Faizy 1 Link to comment Share on other sites More sharing options...
Recommended Posts