Pong Project near completion; looking for Critique.

Started by
9 comments, last by stitchs_login 11 years, 4 months ago
@rip-off:

So, as I said, I am using your notes to improve my game and I implemented Ball::OnPaddleCollision. Then it came to Paddle::OnPoint and I suddenly had a bit of a mind-blank. I was trying to figure out "what does this method need to handle apart from increasing the score by 1?"

I had a brainwave and I wanted to check with you to ensure that I have this right, in my head. I was trying to figure whether the paddle should reset itself on a point, or the Arena. It took me about 15 minutes and then I realised, "If I have a paddle handle it's own reset on a point score, what about the other paddle, and the ball position?". This is definitely something that the Arena needs to handle. To cement what I had just learned, I looked back to the Ball collision method and thought, "Well, when is it appropriate for the Object or the Arena to handle certain functions" such as the balls' direction changing. I imagined having 2 or more balls in play, and this is when it clicked. I realised that if the Arena handled all of these methods (reverse speed, increase speed...) then it will become very messy and confused, because with 2 balls or more, each of these methods need to be repeated. Inevitably, this will make it harder to trace bugs.

To summarise, am I on the correct train of thought? If I am, do I need to try to imagine scenario's like this, to try and make sense of what could happen and how easy it would be if someone using my code wanted to achieve these effects?

Regards,

Stitchs.

This topic is closed to new replies.

Advertisement