Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Chibird

Hi, I just got a leap motion and i was wondering if there was a leap motion plugin for impactjs. I know there are guides for integrating the leap with kiwijs, but im not sure how to use the leap for impact. Would anyone be so kind as to help me out?

Thank You!

1 decade ago by Joncom

I'm not aware of such a plugin for Impact at this time. However one should be possible. How is it you'd like to use the Leap Motion in your Impact game?

1 decade ago by Chibird

Hi, thanks for the reply. I just wanted to make a simple 2d endless run game where the player would use the leap to shoot and jump. I'm kind of new to the leap so im not really sure where I should start.

1 decade ago by Joncom

If it were me, I&039;d try to figure out how to use Leap Motion without Impact for now. See if you can get JavaScript to call #console.log('some action'); and console.log('some other action'); just in JavaScript. Once you know how to do that, it should be a cinch to bring it into Impact.

1 decade ago by Chibird

Thank you for the tip. I got the leap to work without impact, but now im having trouble binding it to a key.

Heres my Leap Code im not sure if this needs to be in ig.global or not
leapjump = false;

Leap.loop(function(frame) {


  // Display Hand object data
  if (frame.hands.length > 0) {
    var height = frame.fingers[2].tipPosition[1];
    if(height > 180) {
      leapjump = true;
    }else{
      leapjump = false;
    }
  }
  console.log(leapjump)
});

I need to somehow add 'leapjump' into this

       ig.input.bind( ig.KEY.LEFT_ARROW, 'left' );
        ig.input.bind( ig.KEY.RIGHT_ARROW, 'right' );
        ig.input.bind( ig.KEY.X, 'jump' ); //ig.game.leapjump = true somewhere in here maybe?
        ig.input.bind( ig.KEY.C, 'shoot' ); 

or it could be in the player.js


 // jump
        if( this.standing && ig.input.pressed('jump') ) {  //maybe ig.game.leapjump = true here?
            this.vel.y = -this.jump;
            this.sfxJump.play();
        }


Anyways thanks again for the tip
Page 1 of 1
« first « previous next › last »