Hacker News new | past | comments | ask | show | jobs | submit login
Electric Potential Pong (html5/processing.js) (dllu.net)
188 points by dllu on March 23, 2012 | hide | past | favorite | 17 comments



Looks like the author is taking advantage of the recently exposed voting forgery:

  <iframe width="1" height="1" scrolling="no" frameborder="0" src="http://news.ycombinator.com/vote?for=3742984&dir=up&whence=newest"></iframe>


Attempted to take advantage.

Doesn't seem to have worked, or at least, I visited the link and it still shows the arrow unvoted.

Edit: Looks like he commented it out before I clicked. So I guess it did work.


I removed the offending code 15 minutes ago.


But I didn't expect it to work! According to the comment at http://news.ycombinator.com/item?id=3742893

"Just loading the vote URL directly or in an img/iframe wont work because votes that don't have a HN referrer don't get counted."

edit: the author of that comment has edited it to remove the part about img/iframe. It DOES work in an iframe in this case.

As of 146 points I have removed the code from the webpage and sincerely apologise for any confusion caused. Nonetheless, I hope that the bug gets fixed soon so that others won't exploit it to promote more malicious sites.


Ah, right. That makes it ok.


no it doesn't, he didn't even obfuscate it in all the JS he had to be loading for that game already. I demand higher quality trickery!!


Game design tip: careful to design your electric field so that the ball doesn't get stuck in the middle.


Good point. I've tested and all the levels are beatable eventually, although some are quite long and difficult. The ball gains some speed with each hit, so eventually it will have the kinetic energy to overcome the potential and behave like classical Pong. If I create a more polished version of this, I will likely design the potentials manually; here I was rather lazy in making this proof-of-concept demo so I generated all the levels randomly.


The opponent board randomly disappeared on level 6 and didn't come back on the next levels. I then easily got to level 9 or 10, where the ball wants to curve to the lower right immediately, and the ball keeps travelling right through my board resulting in instant losses.


This reminds me of Plasma Pong: http://plasmapong.com/ (se website is down)


I feel like the performance of these HTML5 games still isn't quite good enough for them to "take over" just yet.


Looking at chrome's task manager, after just loading the page it's memory use grows from 60MB to 260MB before falling back to 60MB, repeating every 4-5 seconds. That seems a bit wasteful.


processing.js is hardly indicative of HTML5 game performance in general. Also, if this code were to actually only redraw what needs to be redrawn (the paddles and ball), CPU usage would be near 0.


What does this have to do with electricity? I guess "Potential Pong" doesn't sound as good.


The ball is charged and resides in an [electric potential](http://en.wikipedia.org/wiki/Electric_potential).


The inverse square force is extremely common. Plus, I doubt you use the permittivity of free space constant and so on, rather just the inverse square property.


You're absolutely right. Gravity is a force similar to the Coulomb force in this regard. If I were to swap the electric potential for, say, a hilly landscape where the ball is free to roll, then the ball would behave in an identical manner where its acceleration is proportional to the gradient of the height (i.e. it tends to roll downhill); just as how in the electric potential it's proportional to the gradient of potential.

Nonetheless, I like electric potentials. The idea for this game came from my earlier attempt Electric Potential Golf (www.dllu.net/em), which was in turn inspired by Electric Field Hockey (http://phet.colorado.edu/en/simulation/electric-hockey).




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

Search: