At 10/18/09 04:05 PM, lgnxhll wrote:
sorry for triple post but hears some code and all i need is them too fix the ground hittesting cause it doesent work very well dont do anything else too it
ive got everything set up right but the ground hittest wont work help heer it is send it back when you can thanks
Bro, put your code inside code tags god dammit! =P
CODE IN HERE
remove the spaces from tags though.
onClipEvent(load){ _root.grav=0; _root.xmove=0; _root.attack=false; _root.airatk=false; } onClipEvent(enterFrame){ //CEILING SCRIPT while(_root.ceiling.hitTest(_x,_y-25,tru e)&&_root.grav<0){ _root.grav++; } //WALL SCRIPT while(_root.wall.hitTest(_x+117,_y,true)
&&_root.xmove>0){ _root.xmove--; } while(_root.wall.hitTest(_x-17,_y,true)&
&_root.xmove<0){ _root.xmove++; } //GRAVITY SCRIPT _root.grav+=1; this._y+=_root.grav; while(_root.ground.hitTest(_x,_y,true)){ _y--; _root.grav=0; } if(Key.isDown(Key.UP)&&_root.ground.hitT est(_x,_y+3,true)&&_root.attack==false){ _root.grav=-15; } if(_root.grav>15){ _root.grav=15; } //MOVEMENT SCRIPT this._x+=_root.xmove; if(Key.isDown(Key.LEFT)){ _root.xmove-=1.1; _xscale=-100; } if(Key.isDown(Key.RIGHT)){ _root.xmove+=1.1; _xscale=100; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove>0){ _root.xmove-=2; } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove<0){ _root.xmove+=2; } if(_root.xmove>0&&_root.xmove<1.1||_root .xmove<0&&_root.xmove>-1.1){ _root.xmove=0; } if(_root.xmove>1&&_root.xmove<2&&!Key.is Down(Key.RIGHT)){ _root.xmove=0; } if(_root.xmove>10){ _root.xmove=10; } if(_root.xmove<-10){ _root.xmove=-10; } //DISPLAY SCRIPT if(!_root.xmove==0){ _root.attack=false; } if(_root.airatk==false&&!_root.ground.hi tTest(_x,_y+3,true)){ this.gotoAndStop(5); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&!_root.xmove==0&&_root.ground.
hitTest(_x,_y+3,true)){ this.gotoAndStop(3); } if(!Key.isDown(Key.RIGHT)&&!Key.isDown(K ey.LEFT)&&_root.xmove==0&&!Key.isDown(65 )&&_root.attack==false&&_root.ground.hit Test(_x,_y+3,true)){ this.gotoAndStop(1); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.LEFT)
){ this.gotoAndStop(2); } if(_root.ground.hitTest(_x,_y+3,true)&&_
root.attack==false&&Key.isDown(Key.RIGHT )){ this.gotoAndStop(2); } //ATTACK SCRIPT if(Key.isDown(65)&&_root.xmove==0&&_root .ground.hitTest(_x,_y+3,true)){ this.gotoAndStop(4); _root.attack=true; } if(Key.isDown(65)&&!_root.ground.hitTest (_x,_y+3,true)){ this.gotoAndStop(6); _root.airatk=true; } if(!Key.isDown(65)){ _root.airatk=false; } } onClipEvent(enterFrame) { if(_root.player.hitTest(_root.portal)) { nextFrame() } } onClipEvent(enterFrame){ if (_root.this.hitTest(_root.ground){ (_x,_y,true)){ this.gotoAndStop(1); } }