Jump to content

Rendering Game AFTER update()


liakos1992
 Share

Recommended Posts

When changing a sprite's x and y in the update loop, the new position will not show until the next update(). This way, when I attach a health bar on a unit with velocity, while the unit is moving the health bar will always be behind that unit.

 

How can I have the rendering to be done AFTER the "update()" loop?

Link to comment
Share on other sites

As to the health bar, check out preUpdate, which is where the positions of things are calculated. Don't forget to call the base class' preUpdate method too... important stuff happens there.

 

As to rendering the game after update: that's a pretty fundamental change to how Phaser's rendering cycle works. "render after update" is the solution; what's the problem?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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