how to do collision detection for hollow(?) movieclips in flash AS3?

Posted by Pieter888 on Stack Overflow See other posts from Stack Overflow or by Pieter888
Published on 2010-04-19T17:05:32Z Indexed on 2010/04/19 17:13 UTC
Read the original article Hit count: 125

Hey everyone,

I'm making small interactive games in flash to learn AS3, now I ran into a problem that I need some help with.

I need to check the collision between the player and the wall which is normally simple using the hitTestObject function.

But now I made a wall object totally surrounding the player with corridors and turn, a collision playground so to speak.

Now when I use the hitTestObject function to check whether the player is in collision with the wall it tells me it always collides supposedly because the player object is within the bounds of the wall object.

So assuming that I'm correct about the error: How can I prevent getting a collision when I'm inside the bounds of the wall object but not touching the actual walls in that object?

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript-3