I’m working on a game where you hurl projectiles at enemies. I’m using the physics engine to simulate gravity on the projectiles and handle collisions with the bad guys.
I’d like to add heath bars to the enemies, but have seen warnings about display groups and physics objects not doing so well together. What would happen if I did this though? I’d be taking the enemy (an animated sprite and physics body) and putting it inside a display group, then adding a health bar 10px over the enemy’s head, in the same display group. My game loop currently moves the enemy across the screen by modifying its x
value, but I would theoretically want to move its display group instead.
Testing this is my game will require a lot of rewriting, so I’m seeking the wisdom of the masses before I dive in. What’s the right way to accomplish this? Thanks!