So, by using
sortingGroup.sort(FlxSort.byY);
All sprites are supposed to get sorted automatically. But the problem is that in my game there are sprites that are several pixels higher than others, for example: if a char is in front of a bush and the bush is smaller, it will look like the bush is over the player when that shouldn't be the case.
My solution was to give each class (player, enemy, overlay tile, etc.) a value that would be equal to this.y + this.height, this way, the char would have a lower value than the bush and so would stay in the front. But I have NO IDEA how to use the
I've tried to search for examples but found nothing, and I'm clueless as how to use or fill this:
FlxSort.byValues(Order:Int, Value1:Float, Value2:Float) : Int
Thanks for your help