In the stuff I make, I have a variable on the circle called
radius
Now, you would set that up so it works like this
onClipEvent(load) {
radius = 8.5;
}
You can change the 8.5 to something smaller or higher depending on how it turns out in your test.
Now, for the hitTests, you would use a while loop. So you make have something like this
_x += Key.isDown(Key.RIGHT)*power;
_x -= Key.isDown(Key.LEFT)*power;
_y += Key.isDown(Key.DOWN)*power;
_y -= Key.isDown(Key.UP)*power;
// wall22 HitTests
while (_root.wall2.hitTest(_x, _y+radius, true)) {
_y--;
}
while (_root.wall2.hitTest(_x, _y-radius, true)) {
_y++;
}
while (_root.wall2.hitTest(_x-radius, _y, true)) {
_x++;
}
while (_root.wall2.hitTest(_x+radius, _y, true)) {
_x--;
}
And there ya go. Dont worry about the power, I always write that as my speed variables and I just added it in so u could see.
Good Luck on your game