Project Teeter

I recently was contacted by the Developer Relations team at Leap Motion and had a great chat with them. Toward that end, I'm starting to work on a simple game in Processing. All I've done so far is put in some of the basic framework and a simple interaction. Up next is to add game physics, bring in some other objects and integrate the Leap Motion detector. I'd love to put a working processing sketch on the site for you to play with, but I'm unable to get Squarespace to cooperate with Processing.js. Might move to a different host in the future, but for now, here's a video and code below: 

Processing code:

float angle = 0.0;
float rotSpeed = 0.001;
float easing = 0.00007;
int dimX = 640;
int dimY = 360;

void setup() {
size(dimX, dimY);

void draw() {
translate(width/2, 0.8 * height);

// Pivot
float triSide = 50;
float triH = triSide*sqrt(3)/2;
triangle(0, 0, -triSide/2, triH, triSide/2, triH );

// Beam
int rectW = 400;
int rectH = 40;
rect(0, -rectH / 2, rectW, rectH);

if (abs(angle) < asin(2*triH/rectW)) {
//Move towards mouseX with easing
float targetX = mouseX;
angle += (mouseX - width/2) * easing;
} else {
//Hits ground
angle += 0;
stroke(255, 0, 0);
line(-width/2, triSide*sqrt(3)/2, width/2, triSide*sqrt(3)/2);
if (mousePressed) {
angle = 0;