I am creating a simple pong / breakout / arkanoid game in AS2 and not sure how best to deal with the classes.
So far I have a Game.as class, a Paddle.as class and a Ball.as class. I need to detect when the ball (or balls) collide with the Paddle. My question is, which class should check for this collision? Should the Game class do this or should I pass a reference to the Paddle into the Ball class so the Ball is able to check this collision itself? If it is the Game class, then I guess it is a case of giving both the Paddle and Ball classes a method to return their current position and then letting the Game class compare these positions to determine if a collision has occurred? If the Ball class needs to have a reference to the Paddle passed to it, I am not sure how this is done. So I would appreciate any advice on this. I appreciate there are probably a lot of different solutions to this, but I am trying to get off on the right footing with this OOP programming. Many thanks Paul _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com