Then type the following code below "// check if ball hits top or bottom wall" comment inside update() function:: This makes the ball to detect the top and bottom walls and then bounce back. This depends on which paddle the ball hits. Another thing to consider here is the direction of the ball. "wallHitSound" --> plays when the ball hits the top and bottom wall. Now let's call those functions inside render() function. 4. !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)? After downloading it, you will need a program like Winzip to decompress it. (adsbygoogle = window.adsbygoogle || []).push({}); Copyright 2017-2019 by SourceCode and Projects. Atom These kinds of appreciations help me move forward... /* drawing functions */  /* drawing functions end */, https://www.youtube.com/watch?v=gm1QtePAYTM, First, create the root folder which holds everything and name it as "Ping Pong". Now we are going to render some necessary components. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. If the ball does fall through it will stop. Thank you ;), hello , I like the way that you describe this game's codes. I was looking for a good example of inheritance, this is perfect! The Source Code is ready to be downloaded, just kindly click download button below. Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. Do you have source code, articles, tutorials or thesis to share? If nothing happens, download the GitHub extension for Visual Studio and try again. . Car Race Strategy Board Game In PYTHON With Source Code, Last Colony Game In JavaScript With Source Code, Project: Breakout in JavaScript with source code Please scroll down and click on the download button to download Breakout…, Project: Car Racing in JavaScript with source code Please scroll down and click on the download button to…, Project: Bookmarker In JavaScript With Source Code Please scroll down and click on the download button to download Bookmarker…, Project: Typing Speed Calculator In JavaScript With Source Code Please scroll down and click on the download button to download Typing Speed Calculator…, Project: Random Password Generator In JavaScript With Source Code Please scroll down and click on the download button…. You signed in with another tab or window. You signed in with another tab or window. Table tennis, also known as ping pong, is a game in which two or four players hit a little, light ball back and forth across a table using a small paddle. Howdy Folks, in this new tutorial, you will learn how to create the classic Ping Pong Game with Javascript and HTML5 canvas.