FORUMS: list search recent posts

confused about display list and organising my classes

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nicola Elvin
confused about display list and organising my classes
on Mar 6, 2010 at 9:22:34 pm

I'm making the game Breakout as an AS3 application using OOP. I am getting very confused though. I know that objects should be only responsible for themselves. But this is where I get stuck, they need to communicate as some level to add and remove screens, and I am getting majorly confused as to what is going too far, when it could maybe achieved in a simpler more OOP way.

I've worked out the hierarchy of my classes, in terms of where they are being added (I think). Here it is roughly drawn out below.

Have I got the order right based on OOP principles? Like, Introscreen will listen for play being pressed then call a method of the document class that will remove introscreen and then attach gamescreen. Is that right?

Another thing that puzzples me. It seems to me if I made a level and put the paddle and the ball in that, then arranged all the bricks in that level, that I'd be duplicating work (based on the fact I need paddle and ball for level 2 also). So it would be best if I could have gamescreen with paddle and the ball and then add level1/2/3 to display list which would therefore set up the appropriate brick placement. But then, wouldn't that mean that I couldn't do hittests because my level 1/2 or 3 wouldn't be a sibling to the bat and the ball, them residing as a sibling in the level's parent class?

Please help if you can. I'm extremely puzzled and can't stop frowing.





| |



| |


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved