Tuesday, December 9, 2014

Internet Pong Game

Here's a program I wrote earlier this year in July. It's a two-player pong game that involves communicating over the internet using Firebase. As I wrote this program, I also wrote a JavaScript library to take care of graphics and data communication over the internet. The library took the most work; the pong program just required some math and some creativity to help solve the problems I ran into... such as how the two computers would figure out who gets the top paddle and who gets the bottom paddle.

To play the game, you'll need to send the URL to one of your friends (otherwise you won't have an opponent). Move your paddle (the white one) using the arrow keys, and click "Reset" to start over. The ball will bounce to the left or to the right depending on where it hits the paddle – you can use this to your advantage. And forgive the glitches; the computers are communicating over the internet, so it's not going to be perfect.

Have fun!


New posts every month - subscribe for free!

No comments:

Post a Comment