This site requires JavaScript, please enable it in your browser!
Greenfoot back
crazyjack12
crazyjack12 wrote ...

2012/6/22

Kinect with greenfoot

crazyjack12 crazyjack12

2012/6/22

#
hi there guys, i have gotten an xbox 360 Kinect to work with the Greenfoot scenarios you have provided, however i am curious, if the Greenfoot painting scenario allow for two users' to play at one single time, if this is possible could you then please help me with the following code... Here i would like a second user to be able to use their right hand which will move an actor along the X axis depending on where the second user's right hand is... this is just an example but was hoping someone could provide me with the correct code in order for this to work.
    
 public void act() 
{
       PaintWorld world = (PaintWorld)getWorld();

        
        UserData[] users = world.getTrackedUsers();
        for (UserData user : user 2)
        {
            Joint rightHand = user2.getJoint(Joint.RIGHT_HAND);
setLocation(rightHand.getX(), 200);
  }
}
I have grabbed the original code from the painting scenario and have altered the code to help you possibly understand what on earth, i am trying to do.
You need to login to post a reply.