3 ms·
Electric Potential Pong (html5/processing.js)
- techietim 15y agoLooks 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 15y agoBut I didn't expect it to work! According to the comment at http://news.ycombinator.com/item?id=3742893 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.
- akavi 15y agoAttempted 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.
- dllu 15y agoI removed the offending code 15 minutes ago.
- twiceaday 15y agoWhat does this have to do with electricity? I guess "Potential Pong" doesn't sound as good.
- dllu 15y agoThe ball is charged and resides in an [electric potential](http://en.wikipedia.org/wiki/Electric_potential http://en.wikipedia.org/wiki/Electric_potential).
- Reversed 15y agoThis gives me an idea for a project that uses real world pooted ping pong balls: Electrified magnetized pinging pooted pong balls.
- twiceaday 15y agoThe 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 15y agoYou'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 http://phet.colorado.edu/en/simulation/electric-hockey).
- ShardPhoenix 15y agoI feel like the performance of these HTML5 games still isn't quite good enough for them to "take over" just yet.
- pharrington 15y agoprocessing.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.
- Flenser 15y agoLooking 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.
- eberfreitas 15y agoThis reminds me of Plasma Pong: http://plasmapong.com/ http://plasmapong.com/ (se website is down)
- waffle_ss 15y agoThe 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.
- doorty 15y agoGame design tip: careful to design your electric field so that the ball doesn't get stuck in the middle.
- dllu 15y agoGood 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.