I have two types of class instance (Monster and Hero), both are subclass from Actors, which is subclass from FlxSprite.
In PlayState, I add the group one by one, hence causing the screen to render Hero first then Monster sprite will stack on them.
Now, I would like PlayState to treat all these Actor equally, and sort them according to their 'y' value. Not sorting Monster first, then sort Hero.
If there is only one type of class, then I have the solution using FlxSort. This will sort them nicely. I do not know how to combine them into one group and let PlayState sort them.
- I tried to create a new FlxTypedGroup<Actor> to hold both Monsters and Heros, and it would't allow me to, because this group only hold <Actor> not their child class
Any ideas?