"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.
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.
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.
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).