Another question-_-'

ok, i know i’ve been making a lot of threads but this will probably be the last question i want to ask in a while.

so i’ve got this enemy. i want him so that if he hits a (invisible wall), he turns around and walks back.

so, this is the script i’ve got so far, but it doesn’t seem to work.
(this script is on the enemy)

onClipEvent (load){
_x-=random(3)+1;
}

onClipEvent (enterFrame){
if (this.hitTest(_root.wall)){
_rotation=180;
_x+=random(3)+4;
}
}

any suggestions?

well the way you have it set it will only move him one time. So maybe you could try something like…

[AS]
onClipEvent (load) {
speed = 3;
}

onClipEvent (enterFrame) {
_x += speed;
if (this.hitTest(_root.wall)) {
speed *= -1;
}
}
[/AS]

wow cool. thanks Elbudster. this is a great forum:D

I try :b: