Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9082319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:31:52+00:00 2026-06-16T20:31:52+00:00

For a project I need to make a flashgame with the Kinect for Xbox.

  • 0

For a project I need to make a flashgame with the Kinect for Xbox.
Using the AS3NUI library to get acces to most of the Kinect functions worked well for me.

It’s a pong game where you have to move your paddle vertically through hand movement.
I’ve tried a few ways of moving the paddle, but none of them is really accurate. And if they are more accurate, they aren’t smooth at all anymore.

My first methode was setting the paddle.y to the value of the hand.y.

 _paddleLeft.y = (userLeft.leftHand.position.y);

Of course the result was terrible.
This was my next try:

 _paddleLeft.y = (userLeft.leftHand.position.rgbRelative.y * stage.stageHeight*2);

This was pretty accurate, but not smooth at all, and sometimes it was very hard to reach the top of the stage, or the bottom.

At last, I tried something else. I saved the hands last Y position, and checked if the new position was higher or lower, and on that I moved the paddle up or down.

 currYLeft = userLeft.leftHand.position.rgb.y;
 currYRight = userRight.rightHand.position.rgb.y;

if (currYLeft > prevYLeft + 10){
    isDown1 = true;
    isUp1 = false;
}else if( currYLeft < prevYLeft - 10){
    isDown1 = false;
        isUp1 = true;
}

prevYLeft = userLeft.leftHand.position.rgb.y;
    prevYRight = userRight.rightHand.position.rgb.y;

In another enterframehandler, I make them move up or down.

This is the most smooth way I achieved, but it isn’t very accurate anymore. There is some kind of delay wich you don’t have with the first two ways.

I would like to know if it is possible to make the movement smooth AND accurate at the same time? And how this is possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:31:53+00:00Added an answer on June 16, 2026 at 8:31 pm

    If you already have an accurate solution, May be you can try putting some easing in it for the smoothness. You might wanna try using this instead in the enterFrame loop

     _paddleLeft.y += 
                ((userLeft.leftHand.position.rgbRelative.y * stage.stageHeight*2)
                 -_paddleLeft.y)*0.3;
    

    0.3 can be altered to other numbers between 0 and 1, depending on the easing speed you want…That’s my best guess, hope this helps ^^

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project in my IDE. I need to make a shared library
We are reaching a point in our project where we need to make a
I need to make a game in Java for a project. What I'm trying
In my project I need to write small WYSIWYG editor (just let users make
I have a project in Java and I need to make a code listing
In my current project (presentation, slide software) I need to be able to make
I'm using qtip ( http://craigsworks.com/projects/qtip/ ) to make tooltips. Now I need to show
I am starting a new project where we need to make entering web data
I have a situation in my project where i need to make a redirection
I need to make a UML class diagram for a project. I used Sparx

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.