I have a problem regarding the motion and the collision detection through web cam. i have followed the tutorials from the following website http://www.neuroproductions.be/portf…ebcam_tutorial and im not able to understand these lines of code can anyone plz explain me in brief plzz
thanks in advance
[LEFT]function hitDetect() {
var ballX:Number = (ball_mc._x-videoX)/sizeDif;
var ballY:Number = (ball_mc._y-videoY)/sizeDif;
now.draw(video_vobj);
var valNow:Number = (now.getPixel(ballX, ballY) >> 16 & 0xFF);
var valBefore:Number = (before.getPixel(ballX, ballY) >> 16 & 0xFF);
if (valNow>valBefore+30 || valNow<valBefore-30) {
trace("hit");
if (ball_mc._currentframe == 1) {
ball_mc.gotoAndPlay(2);
}
}
before.draw(video_vobj);
}[/LEFT]