DisplayObjectContainer --> numChildren
Been teaching myself programming since the start of 2014. Making simple games for now but as my knowledge grows so will my projects!
Age 38, Male
Indie Game Dev
Oregon
Joined on 12/13/05
DisplayObjectContainer --> numChildren
I like that your giving me short answers to make me work for understanding it. Something is just not clicking with me.
With my previous example in my previous response: container.numChildren would be 5. Doing container.getChildAt (2 or 3 or 4) would show one of the coins...
I feel like I'm missing something to glue this all together. I know doing numChildren will show me everything in that containers display list which then allows me to use getChildAt to grab one object out of it. But that's it. The only thing I've learned to do with these two things are to change the stacking order in the display list...
....and now after playing around with it more I realize I can declare a new variable and make that equal the getChildAt object and use that for hit detection....but that still is just for that one single coin and not the rest....dude I'm lost...toss me another hint...
kkots
DisplayObjectContainer --> getChildAt
HeroPower
Wouldn't that only grab one instance of the coin? If I add my level container to the stage and its display list was (for example) background, player, coin, coin, coin: wouldn't container.getChildAt(3) just grab a single coin? Maybe I'm missing a step on what to do after this....