@@ -0,0 +1,2444 @@
+package com.leapmotionsi;%0A%0Aimport com.leapmotion.leap.Controller;%0Aimport com.leapmotion.leap.Frame;%0Aimport com.leapmotion.leap.Gesture;%0Aimport com.leapmotion.leap.GestureList;%0Aimport com.leapmotion.leap.Listener;%0Aimport com.leapmotion.leap.Vector;%0A%0A/**%0A *%09This class interfaces with the Leap Motion. All controls are handled here.%0A */%0Apublic class LeapListener extends Listener %7B%0A    public void onInit(Controller controller) %7B%0A        System.out.println(%22Initialized%22);%0A    %7D%0A%0A    public void onConnect(Controller controller) %7B%0A        System.out.println(%22Connected%22);%0A        controller.enableGesture(Gesture.Type.TYPE_SWIPE);%0A    %7D%0A%0A    public void onDisconnect(Controller controller) %7B%0A        System.out.println(%22Disconnected%22);%0A    %7D%0A%0A    public void onExit(Controller controller) %7B%0A        System.out.println(%22Exited%22);%0A    %7D%0A%0A    // Keep a reference to the previous change so we can measure the change in hand position.%0A    Frame f;%0A    %0A    public void onFrame(Controller controller) %7B%0A        // Gets the current frame.%0A        Frame frame = controller.frame();%0A%09%09Player p = GameWindow.getGame().getPlayer();%0A        %0A        if (f != null) %7B%0A        %09// Find the difference in the hand's position from the last frame.%0A        %09Vector v = frame.translation(f);%0A        %09if (p != null) %7B    %09%09%0A        %09%09p.changeX((int)(v.getX() * 8));%0A        %09%09p.changeY((int)(v.getY() * -8));%0A        %09%7D%0A        %09System.out.println(v + %22 %22 + frame.currentFramesPerSecond());%0A        %7D%0A        %0A        f = frame;%0A        %0A        if (p != null) %7B%0A        %09// We want to shoot if the player grabs their hand.%0A        %09// It's pretty sensitive, so we shoot at 90%25+%0A        %09p.setGrabbing(frame.hands().rightmost().grabStrength() %3E 0.9);%0A        %09System.out.println(p.isGrabbing());%0A        %7D%0A        %0A        if (GameWindow.getGame().prescreen %7C%7C !GameWindow.getGame().gameOn) %7B%0A        %09// Check if the player swiped to start the game.%0A%09        GestureList gestures = frame.gestures();%0A%09        for (int i = 0; i %3C gestures.count(); i++) %7B%0A%09            Gesture gesture = gestures.get(i);%0A%09            if (gesture.type() == Gesture.Type.TYPE_SWIPE) %7B%0A%09            %09GameWindow.getGame().startGame();%0A%09            %09break;%0A%09            %7D%0A%09        %7D%0A        %7D%0A        %0A        // Slow the input down so we can get more accurate results over time.%0A        try %7B%0A%09%09%09Thread.sleep(10);%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A    %7D%0A%7D%0A

Create LeapListener.java