onClipEvent (load) { xspeed = random(5)+11; yspeed = random(5)+11; } onClipEvent (enterFrame) { this._x += xspeed; this._y += yspeed; if (hitTest(_root.right_wall)==true) { xspeed /= -1; _root.score.text -= -1 } if (hitTest(_root.left_wall)==true) { xspeed /= -1; _root.score.text -= -1 } if (hitTest(_root.top_wall)==true) { yspeed *= -1; _root.score.text -= -1 } if (hitTest(_root.bottom_wall)==true) { yspeed /= -1; _root.score.text -= -1 } if (_root.score.text >= 10) { _root.gotoAndStop(3); } if (hitTest(_root.joe)==true) { _x = random(200); _y = random(200); _root.health.text -= 1 if (_root.health.text < 0) { _root.gotoAndStop(2); } } }