I really need help i have tried to fix this problem and tried a lot of different solutions but none of them working.
I have this code for my character:
onClipEvent (enterFrame) {
radius = _width/2;
if(Key.isDown(Key.UP)){
this._y -= 10;
this.head.gotoAndStop(3);
this.gotoAndPlay(2);
}
if(!Key.isDown(Key.UP)){
this.gotoAndStop(1);
}
if(Key.isDown(Key.DOWN)){
this._y += 10;
this.head.gotoAndStop(1);
this.gotoAndPlay(2);
}
if(!Key.isDown(Key.DOWN)){
this.gotoAndStop(1);
}
if(Key.isDown(Key.LEFT)){
this._x -= 10;
this.head.gotoAndStop(2);
this.gotoAndPlay(2);
}
if(!Key.isDown(Key.LEFT)){
this.gotoAndStop(1);
}
if(Key.isDown(Key.RIGHT)){
this._x += 10;
this.head.gotoAndStop(4);
this.gotoAndPlay(2);
}
if(!Key.isDown(Key.RIGHT)){
this.gotoAndStop(1);
}
while (_root.wall.hitTest (this._x, this._y+radius, true)){
this._y--;
}
while (_root.wall.hitTest (this._x, this._y-radius, true)){
this._y++;
}
while (_root.wall.hitTest (this._x-radius, this._y, true)){
this._x++;
}
while (_root.wall.hitTest (this._x+radius, this._y, true)){
this._x--;
}
}
I can move the char. around and all that but the walking animation won't play.
Any one help with this problem.
Thanks.