Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Just do your project alone using the help given in this project description and from your instructor and GTA only. Finally, you should not post your code nor deploy your project on a public web site.
The pong court is 800x500px, the pong ball is 20x20px, and the paddle is 102x14px. When you click on the Start button or left-click on the court, the ball must 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 on the left, top, and bottom borders of the court. Everytime you hit the ball with the paddle, you add one strike. If the ball crosses the right border (the dotted line), the game is suspended and, if the number of strikes is larger than the Max Score, they become the new Max Score. You would need to click on the Start button or click on the court to restart with a zero number of strikes. 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: relative; 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.
document.getElementById("messages").innerHTML += "... some message ...<br/>";
var bing = new Audio("http://lambda.uta.edu/cse4392/reflect.wav"); bing.play();
Use the form below to submit your pong.html and pong.js files. We do not accept email or hardcopy submissions. 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.Last modified: 09/26/2015 by Leonidas Fegaras