[F8] Problem with hitTest when having Two Walls
I was working on a flash (8) project and I got stuck with the walls.
I made a moving character with 4 walls surrounding him; the walls work fine though. The problem is I wanted to make a 5th wall in the middle simply by duplicating the right wall or making another wall with the same code as the right wall. Which for some reason doesn't work; all the walls work fine except the 5th one which I am able to go through. :confused:
Here's the code for the 4 walls:
onClipEvent (enterFrame) {
if (hitTest(_root.character)) {
_root.left = false;
} else {
_root.left = true;
}
}
onClipEvent (enterFrame) {
if (hitTest(_root.character)) {
_root.up = false;
} else {
_root.up = true;
}
}
onClipEvent (enterFrame) {
if (hitTest(_root.character)) {
_root.right = false;
} else {
_root.right = true;
}
}
onClipEvent (enterFrame) {
if (hitTest(_root.character)) {
_root.down = false;
} else {
_root.down = true;
}
}
Thanks for taking your time to read this... :smoov: