###puckhead.nodejitsu.com
A two-player air hockey game where you move your mallet with your head!
###How to use:
- Allow webcam usage in browser
| var testArray = [[0,3], [2,2], [1,1], [1,1]]; | |
| //This is the main function, which calls the helper functions. | |
| var drawHistogram = function(array){ | |
| //These two steps prepare the inputs for the block that actually draws the histogram. | |
| var combinedHeightsArray = combineHeights(array); | |
| var orderedArray = orderAndFlattenArray(combinedHeightsArray); | |
| //Drawing the histogram. The max height determines how many times drawLine is called. | |
| //It draws the lines from the top down. |
| /* | |
| The main function for finding elements by CSS selector. It checks which type | |
| of selector is being passed in, then either finds the elements right there or | |
| calls a helper function to find the elements. | |
| */ | |
| var findElements = function (selector) { | |
| if (selector[0] === ".") { | |
| return document.getElementsByClassName(selector.slice(1)); | |
| } | |
| else if (selector[0] === "#") { |
| license: gpl-3.0 | |
| border: no | |
| height: 2000 |