At 7/25/09 06:22 AM, UnknownFury wrote:
Stick all the platforms in one MC called 'ground' and then use hitTestPoint. Test multiple points if that is not accurate enough for you.
This'll also let you draw irregular surfaces!
At 7/26/09 05:18 AM, 12121231 wrote:
Thanks, Can i have example please, I'm not very good, just started:)
Something like:
if(ground.hitTestPoint(guy.x, guy.y, true)){
...
};
Bear in mind that hitTestPoint() uses the _root co-ordinate system. If your guy is nested inside something, as will probably be the case if you're using a scrolling screen, you'll need to convert his co-ordinates either manually or with localToGlobal():
absX = holder.guy.x * holder.scaleX + holder.x;
absY = holder.guy.y * holder.scaleY + holder.y;
(Or)
var absPos:Point = new Point(holder.localToGlobal(new Point(holder.guy.x, holder.guy.y));