5 ms·
Browser Pong
- th0114nd 13y agoCool. But it's pretty easy to cheat, just resize your paddle to take up the entire screen and you auto-win.
- infinita740 13y agoThis 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
- b0rsuk 13y agoWhy bother if you can just close the opponent's window ? :D
- pydanny 13y agoSo what? It's cool. Don't cheat.
- OliC 13y agoI honestly thought that moving a browser window with javascript had been impossible since early IE.
- infinita740 13y agoMaybe this is only true for the main browser windows, not small popups
- garethadams 13y agoGenerally speaking, you're allowed to manipulate windows as long as you spawned them
- narsil 13y agoPretty 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 http://stewd.io/pong/lib/pong.js
- rkaplan 13y agoCan 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.
- stewdio 13y agoThere 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 ;)
- skrause 13y agoUsing 'A' and 'Z' for up and down is always great fun on a German keyboard where 'Y' and 'Z' are switched.
- rca 13y agoI 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)
- iHalcyon 13y agoIf 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.
- munimkazia 13y agoJust 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
- xentronium 13y ago> It didn't work for me on Google Chrome (stable) or Chromium on Ubuntu 13.04. Did you disable popup blocker?
- prakster 13y agoWorks very well for me (Chrome, Windows)
- katherineparker 13y agoI used it in Chrome and had to do this for it to work.
- munimkazia 13y agoOh 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).
- Avshalom 13y agoA much older implementation: http://www.project-euh.com/pong/ http://www.project-euh.com/pong/
- RegEx 13y agoStewart Smith has a presentation in which he discusses Browser Pong along with some other projects. It's a very enjoyable presentation to watch! http://vimeo.com/22433439 http://vimeo.com/22433439
- pydanny 13y agoThis is the most awesome use of browser windows ever.
- deadhead 13y agoI 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.
- coldarchon 13y agoI'm pretty sure this has been done 10 years ago on a 4k competition. Meh.
- mvikramaditya 13y agoWasn'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.
- bobsy 13y agoThe 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.
- jmpavlec 13y agoJust delete the opponent window, easy shutout
- stewdio 13y agoI 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 http://dominicmatar.com