Ping Pong Game 🏓

Ping Pong :ping_pong:

Long time FCC’er. I have done all the projects and have been spending time a lot of time on Full Stack React/Node apps. I was looking for something new to try. I decided to make a ping pong game.

I’m not necessarily looking for feedback, but maybe to help someone change it up a little bit. This project broke me out of a little rut and I ended up learning a few new things.

There are many ways to go about making a game like this. I saw some versions with “AI” even. Some people used Canvas, others requestAnimationFrame. Each approach I saw on Codepen was a little different.

I did a simple setInterval with vanilla javascript, mmm, I had Babel on, but didn’t really use it. But I am sure, again, that there are many ways to approach this and many libraries out there that could be useful.

By no means is my code perfect, but I have often found myself searching the net for something new and cool to build with javascript, and as a beginner programmer, the more practice the better.

My Ping Pong on Codepen

Cool One with AI, HORRIBLE SOUND FX - too much cowbell - not mine

First Pong, next World of Pongcraft! :laughing:
Well done :+1:

Seems bugged the speed on reset game, but i can’t remember how i get the bug on second try.
However good job!

I was thinking of something like DuckHunt from old school Nintendo. Thanks for feedback.

1 Like

Yes. I think some of the event listeners need to be removed when reset is it. Thanks for the feedback.

That’s really neat. Some issues on the mouse controls - I completely lost use of the mouse for a few games, could only use the keyboard, and the keyboard responsiveness needs some work, it’s too slow. Really good though. Would be worth looking at porting it to use canvas: manipulating DOM elements means it’s janky, especially at slow ball speeds. One other possible next step - could use exactly the same model to build a Breakout/Arkanoid clone, as what you’ve got is a great basis for that.

Also, maybe for inspiration, this talk is short and fantastic:

1 Like

yes. breakout is for sure a game i actually like to play. i just started looking into canvas, having never used it before. good feedback thanks.

Nice Game Man! I am currently making a ping pong game url(https://codepen.io/ewanlockwood/full/EdVOQx/) but I am stuck on creating a score system. Have you got any tips?