home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / valo.swf / scripts / frame_210 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  1.1 KB  |  64 lines

  1. function testIt(you)
  2. {
  3.    if(bob.hitTest(you))
  4.    {
  5.       if(drawn == 1)
  6.       {
  7.          you._parent.gotoAndStop(3);
  8.       }
  9.    }
  10. }
  11. function hitIt(you)
  12. {
  13.    if(bob.hitTest(you))
  14.    {
  15.       if(drawn == 1)
  16.       {
  17.          life.play();
  18.          you._parent.gotoAndStop(6);
  19.       }
  20.    }
  21. }
  22. function hitIt2(you)
  23. {
  24.    if(you.hitTest(_xmouse,_ymouse,true))
  25.    {
  26.       life.play();
  27.       you._parent.gotoAndStop(6);
  28.    }
  29. }
  30. play();
  31. var time = 600;
  32. var win = 0;
  33. var drawn = 0;
  34. var lastx = 0;
  35. var lasty = 0;
  36. var dist = 0;
  37. var dist2 = 0;
  38. var dist3 = 0;
  39. iPasue.removeMovieClip();
  40. onEnterFrame = function()
  41. {
  42.    if(life._width < 2)
  43.    {
  44.       life._width = 100;
  45.    }
  46.    gameo.iscore.text = "your score is: " + score;
  47.    if(whereTo == 2)
  48.    {
  49.       gameo.passed.text = "you passed " + lvls + " levels";
  50.    }
  51. };
  52. onMouseMove = function()
  53. {
  54.    dist = Math.sqrt(lasty * lasty + lastx * lastx);
  55.    dist2 = Math.sqrt(_xmouse * _xmouse + _ymouse * _ymouse);
  56.    dist3 = dist2 - dist;
  57.    if(dist3 < 0)
  58.    {
  59.       dist3 *= -1;
  60.    }
  61.    lasty = _ymouse;
  62.    lastx = _xmouse;
  63. };
  64.