Welcome to Part 2 of the Actionscript 3 Flash game tutorial series for Pong!
Make sure you check out Part 1 if you haven’t done that already. And if you are completely new to programming, my Getting Started tutorials are the place for you.
Enough talk, let’s code.
Step Two: Program the basic game loop and the ball
First things first, we need to name each instance of our game pieces — this is what we’ll use to refer to each object in the code. Name the paddle on the left “playerPaddle” (no quotes), the paddle on the right “cpuPaddle”, and the ball can just be named “ball”.
In 1972 Atari pioneered the video game industry with the release of Pong. If you think of classic games, Pong is almost always near the top of the list. So it is fitting that Pong should be at least one of your first flash games you make. In this tutorial, we are going to create a complete Pong game from start to finish.
This is intended for beginners, but if you have never programmed at all before you should check out my Getting Started tutorial first.
This is what we are going to create over the next 6 tutorials: