Description: The pong court is 1100x600px, the pong ball is 50x50px, and the paddle is 102x14px. When you click left on the court, the ball will start from a random place at the left border of the court at a random angle between -π/4 and π/4. The paddle can move up and down on the right border by just moving the mouse (without clicking the mouse). The ball bounces at the left, top, and bottom borders of the court. If the ball crosses the right border, you loose a point and the game is suspended (you would need to click on the court again to resume). So the goal of this game is to move the paddle to protect the right border by hitting the ball.
<p id="x" style="position: absolute; left: 50px; top: 100px;"> ... </p>To move this element, just change the left/top attributes using code:
document.getElementById("x").style.top = "10px";Note that the values that you set the left/top attributes must have units (e.g., "10px"). It will not work if you set them to numbers.
Use the form below to submit your pong.html and pong.js files. We do not accept email or hardcopy submissions. You need a username and password to submit your project. You should have already received an email from your instructor at your mavs.uta.edu account with your username and password. You may submit multiple files, if you like, as long as they have different names. These files are automatically uploaded directly into your personal class account for this particular project, so you don't have to include your name or student ID or project number in the file name. You may submit your files as many times as you like, but only the most recently submitted files will be retained and evaluated (newly submitted files replace the old files under the same file name). After you submit the files, please double-check that your submitted files are correct by clicking on the Status link and by playing your game on your browser. If you cannot login or have a problem submitting the project using this form, ask the GTA for help.Last modified: 01/23/14 by Leonidas Fegaras