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 vanillajavascript, 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.
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: