

Electric Potential Pong (html5/processing.js) - dllu
http://www.dllu.net/pong

======
techietim
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>

~~~
dllu
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.

~~~
twiceaday
Ah, right. That makes it ok.

~~~
tripzilch
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!!

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

~~~
dllu
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.

------
waffle_ss
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.

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

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

~~~
Flenser
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.

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

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

~~~
twiceaday
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.

~~~
dllu
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>).

