home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / aliendash.swf / scripts / DefineSprite_28 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  662 b   |  27 lines

  1. width = _parent._width / 2;
  2. height = _parent._height / 2;
  3. if(_parent._y < 250)
  4. {
  5.    _parent._x += _root.speed_car;
  6.    _parent._xscale = 100;
  7.    if(700 < _parent._x)
  8.    {
  9.       _parent.gotoAndStop(1 + random(3));
  10.       _parent._x = -150;
  11.    }
  12. }
  13. else if(250 < _parent._y)
  14. {
  15.    _parent._x -= _root.speed_car;
  16.    _parent._xscale = -100;
  17.    if(_parent._x < -150)
  18.    {
  19.       _parent.gotoAndStop(1 + random(3));
  20.       _parent._x = 700;
  21.    }
  22. }
  23. if(_root.alien._x < _parent._x + width && _parent._x - width < _root.alien._x && (_root.alien._y < _parent._y + height && _parent._y - height < _root.alien._y))
  24. {
  25.    _root.alien.gotoAndStop("die");
  26. }
  27.