I am building a beat'em up game.
I want to put all "enemy" characters into one sprite, where number represents an enemy type animation (1-monster, 2-zombie, 3-soldier), like this:
2_was_killed .... etc.
When "on start of layout" I want to put random sprites on the stage, I make a random number to each instance of an enemy (called "character_type"), and then based on that, I want to use animation based triggers, to do something with the sprite, for example:
"enemy" On animation "was_killed" finished => do some explosion, or whatever...
Now, I should be able to have it rather like that:
"enemy" On animation self.type & "_was_killed" finished => do some explosion, or whatever...
Why do I do that in a such a twisted way: because that way I can define all behaviours for one sprite. Otherwise, if I create 20 different enemy types I will have to have 20 different actions/interactions defined. And if I have to alter something in their code, I will have to update 20 sprites, not just one.
I hope it makes sense what I am typing
Thanks a lot again!