okay so i have a character and i need help with some hittesting. this is the script i'm using to make him walk around
onClipEvent(load){
var speed:Number = 4;
stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){_x+=speed; _root.playermain.player.gotoAndStop(2);}
else if (Key.isDown(Key.DOWN)){_y+=speed; _root.playermain.player.gotoAndStop(5);}
else if (Key.isDown(Key.LEFT)){_x-=speed; _root.playermain.player.gotoAndStop(3);}
else if (Key.isDown(Key.UP)){_y-=speed; _root.playermain.player.gotoAndStop(4);}
else { _root.playermain.player.gotoAndStop(1); }
}
so i need help with two things...
1. When he hits a wall (instance of "wall") he needs to stop rather than walk over the top of it
2. when he hits the door of a building (instance of "door") it changes to a certain frame
i've be struggling with this for quite some time if someone could please help me that would be amazing!
Thankyou!