Pong ~Part 3~ The Player’s Paddle

(This is part 3 of the Pong tutorial series. Please read Part 1 and Part 2 if you haven’t done so already.)

Step Three: Program the Player-controlled Paddle

We got the ball to move and bounce off of the walls in our last tutorial. Now it’s time to program the player-controlled paddle. What does the playerPaddle need to do?

  • Set it’s y-position to the y-position of the mouse
  • Stay within the boundaries of the screen
  • Block the ball from passing through it

This will be a pretty simple tutorial section.

Continue reading

Pong ~Part 2~ Programming the Ball

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”.

Continue reading

Pong ~Part 1~ Setting up the Project

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:

Continue reading