Pong (programmers only)
Due: Wednesday, December 31st at 7:00 pm
In this project, you will implement Pong in a web game platform of your choice: Flash (AS3), HTML5, or Haxe. The goals of this project are to familiarize you with web game programming and to introduce you to game development through implementation of a classic game.
Project Description and Requirements
You should implement Pong with the functionality described below.
Pong is a 2D table-tennis game in which two players defend opposing sides of a
rectangular field, trying to score points by getting a ball past the other player. Your
version should have local multiplayer, such that two people can play on the same
One player defends the left, the other defends the right. Each player controls a rectangular
paddle, which may be moved up or down (but not side-to-side). A rectangular ball moves
around the field, bouncing off the paddles and the top/bottom walls of the field. If the ball
reaches the left/right end of the field, the opposing player gains a point.
When the game starts, it should show a menu screen showing clearly what the input keys
are and which key to press to start the game. This menu screen should also have your name on it.
At the beginning of each point, the ball should start in the middle and can start moving in
any direction at a reasonable speed. If the ball hits a wall, then it should bounce off the
wall with the same speed at an angle that is the same as the angle of incidence. You have
a choice for how the ball reflects from a paddle: it is fine if the ball simply bounces off
the paddle at the same speed as though it were a wall. However, the original creators of
Pong did something more complicated which you are free to try: the speed at which the
paddle is moving and the relative location along the length of the paddle where the ball
hits affect both the angle of reflection and the speed of the reflected ball. You may
experiment if you wish, but should not feel obligated to.
The game must have sound effects when the game starts, a ball hits a paddle or wall, or a
point is scored. These should all be distinct sounds. You can use these sounds: optional Pong assets
The current score should be clearly displayed. After one player has scored 5 points, the
game should go to another screen that shows the winner and the final score. From here
the users should have the option of restarting the game.
You are allowed to use engines for this assignment, such as Flixel, HaxeFlixel, or Phaser
Getting Started with Flash Development
If you choose to do this in Flash, we recommend using FlashDevelop as your IDE. Unfortunately, it's only available on Windows. However, all of the lab computers in Gates G23/G33 can run FlashDevelop, so when starting your first project you can use these computers. Alternatively, you can download a 30-day free trial of Adobe Flash Builder for either Mac or Windows.
Navigate to the FlashDevelop home page and click the Download button. This should take you to the download page. Make sure that you have the pre-requisites installed (listed under the section labeled "Important"). The computers in the CSUG lab (Gates G33) already contain these pre-requisites.
Under the "Download" section, download the relevant package and install it. If you are working on a lab computer, you may want to download and extract the ZIP version and run it from a USB drive, so you don't have to re-download it every time you come to the lab.
When you run FlashDevelop for the first time, another program called AppMan will also appear on screen. If it doesn't, or if you accidentally close it, you can access it again through Tools > Install Software... from within FlashDevelop.
In AppMan, check the boxes for either of the "Flex SDK" options as well as "Flash Player (SA)", and then click on the Install button. After both packages have installed, restart FlashDevelop.
Go to Project > New Project... to create a new project. Make sure to choose "AS3 Project".
You can run the program by clicking the green arrow in the top toolbar. If everything has been set up correctly, you should see a blank white window pop up (and the title should be something like "Adobe Flash Player").
If you get a pop-up about having no valid SDK defined, or if it just doesn't run, follow the directions in the previous screen to install the correct packages in AppMan. Remember to restart FlashDevelop.
You will need to utilize various resources, located here and elsewhere, to finish your submission. Part of this assignment is learning to search for what you need, which is a skill you will need throughout the class. Here are some useful resources:
Erik's slides on ActionScript 3
Hello World! in Actionscript
Hello World! with FlashDevelop and Flixel
Optional Pong assets
Grading is based on how many of the requirements are met.
Academic Integrity Policy
You can discuss this assignment with others and consult online tutorials, but every line of code you write should be your own. No collaboration or copy/pasting is allowed on the code itself.
Turning it in
You should submit whatever we need to run your game (i.e. SWF file, HTML files, other assets) through CMS. Students who are not enrolled in the class should email their submission to the instructor.