home *** CD-ROM | disk | FTP | other *** search
- speed = 0.8 * r.espeed;
- y = _Y;
- stick = 0;
- name = "bunny";
- d = 12;
- if(_parent._name == "enemymap")
- {
- initme();
- }
- else
- {
- onenterframe = function()
- {
- d--;
- dx = _X - s._x;
- dy = _Y - s._y;
- if(!stick)
- {
- ang = math.atan2(dy,dx);
- xs = speed * math.cos(ang);
- ys = speed * math.sin(ang);
- if(d > 0)
- {
- _X = _X + 0.7 * xs;
- }
- else
- {
- _X = _X + xs;
- }
- _Y = _Y + ys;
- if(dx * dx + dy * dy < 100)
- {
- stick = 1;
- }
- _rotation = deg(ang);
- }
- else
- {
- _X = s._x + (_X - s._x) / 10;
- _Y = s._y + (_Y - s._y) / 10;
- }
- cekhit();
- if(hit)
- {
- gotoAndPlay(5);
- }
- if(!r.inv)
- {
- if(s.hittest(_X,_Y,1))
- {
- r.hit = 1;
- gotoAndPlay(5);
- }
- }
- if(_X < -30)
- {
- this.removeMovieClip();
- }
- };
- }
- stop();
-