home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / crazycube.swf / scripts / __Packages / com / Cub.as next >
Encoding:
Text File  |  2006-06-13  |  1.8 KB  |  62 lines

  1. class com.Cub
  2. {
  3.    var clip;
  4.    var nodes;
  5.    var n0;
  6.    var n1;
  7.    var n2;
  8.    var n3;
  9.    var n4;
  10.    var n5;
  11.    var n6;
  12.    var n7;
  13.    var poly0;
  14.    var poly1;
  15.    var poly2;
  16.    function Cub(_clip, _nodes)
  17.    {
  18.       this.clip = _clip;
  19.       this.nodes = _nodes;
  20.       this.create();
  21.    }
  22.    function create()
  23.    {
  24.       this.n0 = new com.Node(-50,-50,-50);
  25.       this.n1 = new com.Node(-50,-50,50);
  26.       this.n2 = new com.Node(50,-50,50);
  27.       this.n3 = new com.Node(50,-50,-50);
  28.       this.n4 = new com.Node(-50,50,-50);
  29.       this.n5 = new com.Node(-50,50,50);
  30.       this.n6 = new com.Node(50,50,50);
  31.       this.n7 = new com.Node(50,50,-50);
  32.       var _loc3_ = 0;
  33.       while(_loc3_ < 8)
  34.       {
  35.          this.nodes.push(this["n" + _loc3_]);
  36.          _loc3_ = _loc3_ + 1;
  37.       }
  38.       var _loc4_ = -2;
  39.       this.poly0 = new com.Polygon(this.clip.createEmptyMovieClip("cub_mc_" + this.clip.depth,this.clip.depth++),_loc4_);
  40.       this.poly0.addNode(this.n4);
  41.       this.poly0.addNode(this.n5);
  42.       this.poly0.addNode(this.n6);
  43.       this.poly0.addNode(this.n7);
  44.       this.poly1 = new com.Polygon(this.clip.createEmptyMovieClip("cub_mc_" + this.clip.depth,this.clip.depth++),_loc4_);
  45.       this.poly1.addNode(this.n7);
  46.       this.poly1.addNode(this.n6);
  47.       this.poly1.addNode(this.n2);
  48.       this.poly1.addNode(this.n3);
  49.       this.poly2 = new com.Polygon(this.clip.createEmptyMovieClip("cub_mc_" + this.clip.depth,this.clip.depth++),_loc4_);
  50.       this.poly2.addNode(this.n0);
  51.       this.poly2.addNode(this.n4);
  52.       this.poly2.addNode(this.n7);
  53.       this.poly2.addNode(this.n3);
  54.       _loc3_ = 0;
  55.       while(_loc3_ < 3)
  56.       {
  57.          _global.polygons.push(this["poly" + _loc3_]);
  58.          _loc3_ = _loc3_ + 1;
  59.       }
  60.    }
  61. }
  62.