Thanks guys! I'm a little confused regarding the text in enemy method.
Hendriza01, I too thought of creating an actor for each number, then label each actor with their respective number, tween the actors then play with opacity and kill self. But yes, as you mentioned, it's probably not an efficient method.
Thanks!
Hey chongyunxiang, well the Image API is more efficient than using an actor for each number, because essentially you are manipulating an image rather than an actor. So it doesn't use that much in terms of resources. I believe this is one of the reasons the Image API was created, so instead of having hundreds of actors on the screen at once, you can have hundreds if image instances of just one image on the screen to create various types of effects. When I was testing it, it caused almost no drop in FPS, and I had bullets flying and various actors moving around taking damage and the Image API just handled it without any issues.
But again, there could be an easier way like "t4u" mentioned above, although I am not too sure what he meant either. Maybe he meant something like creating an actor attached to your player (like a small rectangle which has opacity of zero), and then when he takes damage, you draw a font onto the actor and make it visible. And let it fade out again.
Or maybe t4u meant just having drawing a font directly onto the actor itself just above it's head. If the font is empty, it won't draw anything. When he takes damage, some font will be drawn and it will show above his head. Then you just set the font to empty / blank space again after 1 sec or something.