FlxTypedGroup<FlxTypedGroup<T>> updates the elements but doesn't render them on Windows
-
Hello!
So, I have a
FlxTypedGroup
object which can contain severalFlxTypedGroup
forFlxSprite
(bullets). For short, the type of the object isFlxTypedGroup<FlxTypedGroup<Bullet>>
.
(Note: In my game, the typedef ofFlxTypedGroup<Bullet>
isBulletPool
, inspired by this tutorial.)I made this because I want to create several
FlxTypedGroup<Bullet>
in aFlxSprite
object and add them directly into the game state. As shown below:PlayState.hx
public var boss:Boss; public var eneBullets:FlxTypedGroup<FlxTypedGroup<Bullet>>; public function create(){ ... //create boss eneBullets = boss.allBullets; add(eneBullets); }
Boss.hx
public var allBullets:FlxTypedGroup<FlxTypedGroup<Bullet>>; public static function createWeapon(_i:Int){ var pool = new FlxTypedGroup<Bullet>(_i); allBullets.add(pool); }
It's working fine in the Neko and HTML5 target. But in the Windows target (c++), the bullets are updated, but not rendered... I know this is a problem with the
FlxTypedGroup<FlxTypedGroup<T>>
thing because I have aFlxTypedGroup<Bullet>
object in the game state and it has no problem.So I want to know if it's a known problem, and if there a better alternative to "a group inside a group" that could work...
Thank you!