home *** CD-ROM | disk | FTP | other *** search
- range = 200;
- speed = r.runspeed;
- xmin = _X - range;
- xmax = _X + range;
- shotdelay = 10;
- runtime = 150;
- blast._visible = 0;
- x = _X;
- run = 0;
- onenterframe = function()
- {
- if(run)
- {
- if(p._x > _X + speed)
- {
- xs = speed;
- }
- else if(p._x < _X - speed)
- {
- xs = - speed;
- }
- else
- {
- xs = 0;
- }
- _X = _X + xs;
- if(_X > xmax)
- {
- _X = xmax;
- xs = - xs;
- }
- else if(_X < xmin)
- {
- _X = xmin;
- xs = - xs;
- }
- d--;
- if(!d)
- {
- d = shotdelay;
- blast._visible = 1;
- blastdelay = 4;
- }
- if(blastdelay > 0)
- {
- blastdelay--;
- cekhitp(z2);
- if(!blastdelay)
- {
- blast._visible = 0;
- }
- }
- rund--;
- if(rund < 20)
- {
- _X = x + (_X - x) / 1.2;
- }
- if(rund < 0)
- {
- run = 0;
- blast._visible = 0;
- }
- }
- if(!run and z2.hittest(p.z))
- {
- run = 1;
- rund = runtime;
- blastdelay = 0;
- d = shotdelay;
- }
- cekhitp(z);
- };
- stop();
-