home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Classicos / pepsi_pinball.swf / scripts / frame_8 / DoAction.as < prev   
Encoding:
Text File  |  2006-05-18  |  1.8 KB  |  95 lines

  1. function Position(x, y)
  2. {
  3.    this.x = x;
  4.    this.y = y;
  5. }
  6. function tVector(x, y)
  7. {
  8.    this.x = x;
  9.    this.y = y;
  10.    this.norm = dist(0,0,x,y);
  11.    this.phiRad = Math.atan2(y,x);
  12.    this.phiDeg = this.phiRad * toDeg;
  13. }
  14. function tBall(mc, pos, vel)
  15. {
  16.    this.mc = mc;
  17.    this.pos = pos;
  18.    this.vel = vel;
  19.    this.oldPos = new Position();
  20.    this.mode = undefined;
  21. }
  22. function tWall(mc, angle, pos)
  23. {
  24.    this.mc = mc;
  25.    this.angle = angle;
  26.    this.pos = pos;
  27.    this.strength = 1;
  28. }
  29. function tFlipper(mc, angle, length, pos)
  30. {
  31.    this.mc = mc;
  32.    this.angle = angle;
  33.    this.moving = 0;
  34.    this.length = length;
  35.    this.pos = pos;
  36. }
  37. function tBumper(mc, radius, strength, pos, clip)
  38. {
  39.    this.mc = mc;
  40.    this.radius = radius;
  41.    this.strength = strength;
  42.    this.pos = pos;
  43.    this.clip = clip;
  44. }
  45. function tTarget(mc, radius, strength, pos, hitStatus)
  46. {
  47.    this.mc = mc;
  48.    this.radius = radius;
  49.    this.strength = strength;
  50.    this.pos = pos;
  51.    this.hitStatus = hitStatus;
  52.    this.pos = pos;
  53.    this.setOn = function()
  54.    {
  55.       this.mc.gotoAndStop("on");
  56.       this.hitStatus = true;
  57.    };
  58.    this.setOff = function()
  59.    {
  60.       this.mc.gotoAndStop("off");
  61.       this.hitStatus = false;
  62.    };
  63. }
  64. function tSwitch(mc, hitStatus)
  65. {
  66.    this.mc = mc;
  67.    this.hitStatus = hitstatus;
  68.    this.setOn = function()
  69.    {
  70.       this.mc.gotoAndStop("on");
  71.       this.hitStatus = true;
  72.    };
  73.    this.setOff = function()
  74.    {
  75.       this.mc.gotoAndStop("off");
  76.       this.hitStatus = false;
  77.    };
  78. }
  79. function tbonus(mc)
  80. {
  81.    this.mc = mc;
  82.    this.setOn = function()
  83.    {
  84.       this.mc.gotoAndStop("on");
  85.       this.status = true;
  86.    };
  87.    this.setOff = function()
  88.    {
  89.       this.mc.gotoAndStop("off");
  90.       this.status = false;
  91.    };
  92.    this.setOff();
  93. }
  94. play();
  95.