Fig 1 - Screen Shot of Brick Out Game Fig 2 - UML Design of BrickOut Game Reverse engineered using WithClass 2000Way back, I'd say about 1981 (ok maybe not so far back!), there was a game for the Apple II called Brick Out. The game was actually a bit more complex than the one I'm presenting here. The object of the game was to knock out all the brick by hitting a ball with a paddle against the bricks. This source code was provided at the time( in Apple Basic) and boasted 'Hi-Res' Graphics. People are probably laughing at what was considered high resolution back then. Still it was a fun computer to learn game programming.This game uses a timer to control the speed of the ball. The timer event handler draws the ball in its new position each time a timer Interval occurs, so changing this Interval changes the speed of the ball. Collisions of the Ball are also tested each time a timer Interval occurs. If the ball collides with something like a brick, or the side of the form, or the paddle, the ball will change to the appropriate direction. The paddle is divided up into different colllision sections, each section determines what vector velocity pair the ball will come off the paddle with. If the ball misses the paddle, the next ball is released from the left hand side of the form.The Paddle is controlled by the right and left arrow keys on the keyboard. The game starts, when one of these keys is pressed. Below is the code for interpreting the arrow keys on the form. This code requires that the Form's KeyPreview property is set to true. This way when the arrow key is pressed, the form will trap the KeyDown event and you can interpret what key is pressed by looking at the KeyData:Listing 1.1 - KeyDown Event for Left and Right Arrows
private