home *** CD-ROM | disk | FTP | other *** search
- class cBeam
- {
- var leftBeam;
- var rightBeam;
- var beamWidth;
- var sizeY;
- var sizeX;
- var y;
- var dy;
- var inc;
- var kind;
- var x;
- static var stSolid = 0;
- static var stSoft = 1;
- function cBeam(mc1, mc2)
- {
- this.leftBeam = mc1;
- this.rightBeam = mc2;
- this.beamWidth = mc1._width;
- this.sizeY = Stage.height + 100;
- this.sizeX = Stage.width - 50;
- trace(this.sizeX);
- this.y = this.sizeY;
- this.dy = -5;
- this.inc = false;
- this.kind = cBeam.stSolid;
- this.newPos();
- }
- function newPos()
- {
- this.x = Math.round(Math.random() * this.sizeX);
- if(this.x % 3 == 0)
- {
- this.kind = cBeam.stSoft;
- this.leftBeam.gotoAndStop(2);
- this.rightBeam.gotoAndStop(2);
- }
- else
- {
- this.kind = cBeam.stSolid;
- this.leftBeam.gotoAndStop(1);
- this.rightBeam.gotoAndStop(1);
- }
- trace(this.x);
- this.leftBeam._x = _root.offsetX + this.x - _root.holeHalfWidth;
- this.rightBeam._x = _root.offsetX + this.x + _root.holeHalfWidth;
- this.leftBeam._y = this.y;
- this.rightBeam._y = this.y;
- }
- function move()
- {
- this.y = this.y - 1;
- this.leftBeam._y = this.y;
- this.rightBeam._y = this.y;
- if(this.y < 0)
- {
- this.y = this.sizeY;
- this.newPos();
- }
- _root.checkPos();
- }
- function hide()
- {
- this.y = this.sizeY;
- this.leftBeam._y = this.y;
- this.rightBeam._y = this.y;
- }
- }
-