I have searched the foru and read the tutorial on how to do this so I tried to get my own code out of it…
What Im doing is I have a character and he can walk around… whenever he gets to a wall I want him to stop…
here is my code
onClipEvent (enterFrame) {
if (wall1.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= 1;
}
if (wall1.hitTest(getBounds(_root).xMin, _y, true)) {
_x += 1;
}
if (wall1.hitTest(_x, getBounds(_root).yMax, true)) {
_y -= 1;
}
if (wall1.hitTest(_x, getBounds(_root).yMin, true)) {
_y += 1;
}
}
hmm i dont know whats wrong with this… I have basically a character… you can move him around with the arrow keys… i want it so that if you walk into a wall it will stop…
fluid_tw0:
yours didn’t work at all
and
mlkdesign:
im using controlment using the arrow keys… your .fla is automated… im putting the actions on the character movieclip