Thank you alihassan, i was thinking of a similar solution but wanted an alternative one. I guess I'll have to go with that one!
Gabriel Reinhart Allard
@Gabriel Reinhart Allard
0
Reputation
2
Posts
362
Profile views
0
Followers
0
Following
Posts made by Gabriel Reinhart Allard
-
RE: How can I add two different classes in a single Array?
-
How can I add two different classes in a single Array?
I have two classes, the Player class and the Enemy class, both of them extend from FlxSprite obviously and both have a public variable called "CT" that I want to access through a for loop.
The problem is that, if I add them to a FlxGroup or FlxSpriteGroup, they are considered FlxBasic or FlxSprites respectively and so the CT is nonexistent.
Another doubt I have is, if it's possible to add two different classes in a single Array?
Any solution is appreciated, thank you!