Need help!
I got this code but the guy just falls through the floor.
I got an mc inside stick that's called feet, and the ground called... ground!
The codes that aquire the while loop are in bold.
leftrot=_root.stick.body.leftarm._rotati on;
rightrot=_root.stick.body.rightarm._rota tion;
grav=2;
acc=.25;
rspeed=0;
lspeed=0;
jspeed=10;
bspeed=3;
lacc=.2;
racc=.2;
jump=false;
ready=false;
numCopies=50;
copyCount=0;
ball.swapDepths(50000);
stop();
stick.onEnterFrame=function(){
var point:Object = new Object();
point.x = this.feet._x;
point.y = this.feet._y;
this.localToGlobal(point);
this.body.leftarm._rotation+=grav/Math.P I;
this.body.rightarm._rotation-=grav/Math.
PI;
if(grav<=0){
this.body.leftarm._rotation=leftrot;
this.body.rightarm._rotation=rightrot;
}
if(this.body.leftarm._rotation>=90){
this.body.leftarm._rotation-=grav/Math.P I;
this.body.rightarm._rotation+=grav/Math.
PI;
}
cam._x=this._x;
cam._y=this._y;
if(!_root.ground.hitTest(point.x,point.y ,true)){
grav+=acc;
this._y+=grav;
acc=.25;
}
while(_root.ground.hitTest(point.x,point .y,true)){
grav=0;
acc=0;
ready=true;
}
if(Key.isDown(65)){
lspeed+=lacc;
this._x-=lspeed;
}
if(!Key.isDown(65)){
lspeed=0;
}
if(Key.isDown(68)){
rspeed+=racc;
this._x+=rspeed;
}
if(!Key.isDown(68)){
rspeed=0;
}
if(Key.isDown(87)&&ready==true){
this._y-=jspeed;
jump=true;
}
if(!Key.isDown(87)&&!this.feet.hitTest(_
root.ground)&&jump==true){
this._y-=jspeed;
jump=false;
ready=false;
}
if(Key.isDown(Key.LEFT)){
this.body.leftarm.leftweapon.prevFrame()
;
this.body.rightarm.rightweapon.prevFrame ();
}
if(Key.isDown(Key.RIGHT)){
this.body.leftarm.leftweapon.nextFrame()
;
this.body.rightarm.rightweapon.nextFrame ();
}
}
ball.onEnterFrame=function(){
getX = _root.stick._x;
getY = _root.stick._y;
gotoX = (getX-this._x)/_root.bspeed;
gotoY = (getY-this._y)/_root.bspeed;
this._x += gotoX;
this._y += gotoY;
}
onEnterFrame=function(){
copyCount++;
alphadown=200/numCopies;
duplicateMovieClip ("ball","dmc"+copyCount,copyCount+10);
_root["dmc"+copyCount].onEnterFrame = function(){
if(this._xscale>20){
this._xscale-=alphadown;
this._yscale-=alphadown;
}else{this.removeMovieClip();
}
}
}