But it stopped the movieclip before it even touched the wall, and you could move a short distance if you let go of right/left until you eventually passed the boundry anyway. Any Suggestions?
im no great Expert yet…infact i just started my self. this forum is a great place to learn. i just learned clipping the other day…use something like this
if(this.hitTest(_root.wall)) {
_y -= speed;
}
for down use this _y -= speed;
for up _y += speed;
for right _x -= speed;
for left _x += speed;
im not to good at explaining things but if you are confused with this i can try fixing your source manually… @.@
And then on the objects that would have hit detection, simply do a movement in the opposite direction:
if(_root.character.hitTest(this)){
character._x -= character_speed;
}
So far, it is working flawlessly for me. I don't ever have to worry about changing the character speed to one thing or another, and since both of the codes can be executed on keyPress, the will work at the same time, thereby nullifying your characters movement.
I think that is what Bahamut was getting at.