I have problem, it may be stupid, but i have no idea how to solve it. Furthermore I don’t even know what causes it.
I have a MovieClip “world” on my main stage, it contains level and player. I use standart (?) code for moving my player
if (Key.isDown(Key.LEFT) || Key.isDown(65))
{
_x -= speed;
}
etc
and this code to check the collision with level walls
while (_parent.walls.hitTest(_x, _y+radius, true))
{
_y–;
}
while (_parent.walls.hitTest(_x, _y-radius, true))
{
_y++;
}
while (_parent.walls.hitTest(_x-radius, _y, true))
{
_x++;
}
while (_parent.walls.hitTest(_x+radius, _y, true))
{
_x–;
}
Where radius is Math.max(_width,_height)/2+1;
What is the problem : when I move my “world” movieclip (containing all other MCs) there is a problem with collision detection. The picture of the walls moves correctly, but the collision is detected like if it was moved further.
I deleted all actionscript, leaving only moving and collision detection and i really don’t know what is going on.
You can see what I mean in attachment (space to move the container MC)