Hacker News new | past | comments | ask | show | jobs | submit login
Browser Pong (stewd.io)
66 points by AbhishekBiswal on June 27, 2013 | hide | past | favorite | 28 comments

The first game on HN which I actually competed. Great fun.

Had a rather fantastic come back from 1 - 9 down to win 12 - 10 against the computer. Fairly beatable once you get the technique down.

My heart stopped at 8 - 9 when I dropped a point and thought I had lost. The shot was a horizontal slow shot from left to right and for some reason I moved out the way..

Never found pong so thrilling. Must play it more often.

Cool. But it's pretty easy to cheat, just resize your paddle to take up the entire screen and you auto-win.

This can lead to a bug, if you play human vs human and resize both paddles, the "ball" speed up and eventually go through one of the paddles

Why bother if you can just close the opponent's window ? :D

So what? It's cool. Don't cheat.

I don't understand what it's supposed to do, it just spawned three windows, one plain yellow and the two others with 3 stripes and an increasing counter. Is that a bug or did I miss something? (I tested with up-to-date firefox and chromium, same thing)

If the windows are not moving, then it is a bug (although, check that you haven't clicked pause on the game). Otherwise, they should be moving and recreating the game pong. The plain yellow is the ball, the striped are the paddles for the characters (controlled by A&Z for the left one and UP&DOWN for the right one). Tick one of the boxes as non human to play against a computer.

Oh, the windows are supposed to be the game! Ok, then it's not a bug (per se) but I'm using a tiling wm, it's preventing the windows from moving. Thanks for the explanation.

I had the same problem

Just FYI.. It didn't work for me on Google Chrome (stable) or Chromium on Ubuntu 13.04.. It did work in Firefox. Pretty crazy use of windows. Also, I tried my best to beat the AI, but couldn't! That's a hard game

> It didn't work for me on Google Chrome (stable) or Chromium on Ubuntu 13.04.

Did you disable popup blocker?

Oh yeah! That was probably what was stopping it from working. It did open up the opponents window though. I think the score raised to 2 after some moving around and then stopped (I guess it was my turn then).

Works very well for me (Chrome, Windows)

I used it in Chrome and had to do this for it to work.

Pretty good. The source code [1] is also clean and commented. The randomized increasing velocity was a nice touch.

[1] http://stewd.io/pong/lib/pong.js

Can anyone explain this a quirk line of the source code to me? (In the framebuster portion at the top of the file):

window.location.href = 'ht' + 'tp' + ':' + '//stewd'+ '.io/' + 'pong';

Why has he written 'ht' + 'tp' + ':' etc instead of just the URL as one string? My suspicion is something to do with preventing framebuster-busters from working, but I'm not sure. I've never seen that before.

There are sites out there that attempt to offer a service that protects your privacy by fetching websites for you through their servers and then pass you the content afterward—so your IP isn’t part of the request chain. That sounds like a nice service. Unfortunately I found there were 3 problems with a particular company offering this service:

1. From what I’ve read these guys just pass your info on to interested agencies anyway, entirely defeating the purpose. 2. In order to offer the service for free they insert adverts into the content—I assume to cover their operational costs. 3. This particular agency was able to get a pretty high search engine result—rivaling my own URLs—by just copying my stuff, Browser Pong being a prime example.

At the time this meant if someone liked what I did and searched for it there was a good chance they’d end up visiting a boxed in version of Pong with adverts on it. Aside from some tongue-in-cheek exceptions I’ve been firm about not putting ads on my sites. (And for the most part this doesn’t matter because they don’t get a ton of hits, but when something blows up like Pong or Jed there’s you know ... like maybe a whole $29.95 to be made there.) I made these things for the enjoyment of it and didn’t want to dilute them with ”a word from our [randomly selected] sponsor.” So I started experimenting and figured out how this company was parsing the HTML, CSS, and JavaScript to patch the links so everything would go through their servers. The code snippet you pointed out was just a quick way to hide the URL from their parser and get them out of my hair.

I don’t have anything against ad-based models or referencing someone else’s work (obviously). But in this particular case I felt it crossed a line so I pulled the trigger. I hope that answers your question ;)

I feel compelled to point out that all of Browser Pong’s sounds were composed specifically for it by a Mr. Dominic Matar who is not only a multi-talented musician, earnest with feedback, and strikingly handsome—he’s also a breeze to collaborate with. So if you’re looking for that sort of person for a project do check out his stuff and drop him a line: http://dominicmatar.com

I honestly thought that moving a browser window with javascript had been impossible since early IE.

Generally speaking, you're allowed to manipulate windows as long as you spawned them

Maybe this is only true for the main browser windows, not small popups

Stewart Smith has a presentation in which he discusses Browser Pong along with some other projects. It's a very enjoyable presentation to watch!


I have two monitors (Google Chrome on Ubuntu). The paddles appeared on one while the ball appeared on the other. It was still playable, but was rather odd lining up the paddle against the ball on a different monitor.

Wasn't this one of the original "Chrome Experiments"? I remember there being quite a lot of them, most of which were fun to play with.

Using 'A' and 'Z' for up and down is always great fun on a German keyboard where 'Y' and 'Z' are switched.

A much older implementation:


This is the most awesome use of browser windows ever.

Just delete the opponent window, easy shutout

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact