home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / eolica.swf / scripts / frame_12 / DoAction.as
Encoding:
Text File  |  2005-07-26  |  1.3 KB  |  58 lines

  1. JetStreamIcon = function(game_x, game_y)
  2. {
  3.    GAME.mc.attachMovie("jet_stream_icon","jet_stream_icon" + GAME.drawIndex,GAME.drawIndex);
  4.    this.mc = GAME.mc["jet_stream_icon" + GAME.drawIndex];
  5.    this.id = "jet_stream_icon" + GAME.drawIndex;
  6.    this.mc.obj = this;
  7.    GAME.drawIndex = GAME.drawIndex + 1;
  8.    this.lastTime = getTimer();
  9.    this.game_x = Number(game_x);
  10.    this.game_y = Number(game_y);
  11.    GAME.drawOnScreen(this,true);
  12.    this.mc.onEnterFrame = function()
  13.    {
  14.       this.obj.loop();
  15.    };
  16. };
  17. t = JetStreamIcon.prototype;
  18. t.mc = false;
  19. t.id = "";
  20. t.age = 0;
  21. t.lastTime = 0;
  22. t.game_x = 0;
  23. t.game_y = 0;
  24. t.min_game_x = 0;
  25. t.max_game_x = 0;
  26. t.maxLifeTime = 5000;
  27. t.hitByWindGust = function(windGust)
  28. {
  29.    GAME.turnOnJetStream();
  30.    GAME.removeHitObject(this);
  31.    delete this.mc.onEnterFrame;
  32.    this.mc.gotoAndPlay("hit_hide");
  33. };
  34. t.onTimeUp = function()
  35. {
  36.    GAME.removeHitObject(this);
  37.    delete this.mc.onEnterFrame;
  38.    this.mc.gotoAndPlay("no_hit_hide");
  39. };
  40. t.loop = function()
  41. {
  42.    this.age += getTimer() - this.lastTime;
  43.    this.lastTime = getTimer();
  44.    this.mc.age_out = this.age;
  45.    if(this.age > this.maxLifeTime)
  46.    {
  47.       this.onTimeUp();
  48.    }
  49. };
  50. t.remove = function()
  51. {
  52.    GAME.removeObject(this);
  53. };
  54. t.toString = function()
  55. {
  56.    return "[JetStreamIcon]";
  57. };
  58.