Joe Polak, iChemLabs
This game was created as a plugin to the ChemDoodle Web Components library. The main piece of code is a new <canvas> called PongCanvas, which is a child of the _AnimatorCanvas class in the ChemDoodle Web Components library. The background image is set using the _Canvas.setBackgroundImage() function. A compatible MOL file of the benzene ring was generated using ChemDoodle Desktop and loaded into the Canvas using the _Canvas.loadMolecule() fuction. The ring’s color and line thickness were changed by altering the appropriate visual specifications. The rotation effect was achieved using a method similar to the RotatorCanvas. Everything else you see in the game –the paddles, the score and the game over messages– was drawn by overriding the _Canvas.drawChildExtras() function. Input handling was done by defining the _Canvas.click() and _Canvas.mousemove() functions, and mobile support was written in by mapping _Canvas.touchmove() to _Canvas.mousemove(). If you’re using this demo on a desktop browser, you’ll notice some neat sound effects. These were made possible using the HTML5 <audio> tag.