PDA

View Full Version : Boxes and more boxes #2



esnetni
January 14th, 2006, 01:42 AM
My second entry

_root.createEmptyMovieClip("square", 0), i=0;
square.beginFill(0x0), square.moveTo(-5, -5), square.lineTo(-5, -5), square.lineTo(-5, 5), square.lineTo(5, 5), square.lineTo(5, -5), square.endFill();
square._x=Stage.width/2, square._y=Stage.height/2;
function create() {
square.duplicateMovieClip("explode"+[++i], _root.getNextHighestDepth(), {_x:stage.width/2, _y:stage.height/2, clr:"0x"+random(999999), _rotation:random(359), dir:random(10)+5, onEnterFrame:function () {
var cl:Color = new Color(this);
this._xscale=this._yscale -= 1, cl.setRGB(this.clr);
this._x += Math.sin(this._rotation*(Math.PI/180))*this.dir, this._y -= Math.cos(this._rotation*(Math.PI/180))*this.dir;
this._alpha -= 1.5, this._xscale=this._yscale += random(10), this._alpha<5 ? this.removeMovieClip() : this._alpha -= 3;
}});
}
setInterval(create, 20);

kirupa
January 14th, 2006, 01:45 AM
I can't see anything :alien:

hybrid101
January 14th, 2006, 01:52 AM
me either

freeskier89
January 14th, 2006, 01:53 AM
Boxes and more boxes fail to appear. :) Whats with all of the commas in there? Aren't they supposed to be semicolons?

esnetni
January 14th, 2006, 02:04 AM
I fixed it

kirupa
January 14th, 2006, 02:07 AM
square.beginFill(0x0), square.moveTo(-5, -5), square.lineTo(-5, -5), square.lineTo(-5, 5), square.lineTo(5, 5), square.lineTo(5, -5), square.endFill();
That should be split into multiple lines. You have too many statements separated by commas. The only "correct" place you used commas was when assigning the duplicateMovieClip properties in-between the { } tags. Everywhere else, you can't do that for this contest.

While you may, even by spreading out the commas into statements, fall within the 25 line limit, it makes the code more suspicious if you use commas like that :P

:cool:

NiñoScript
January 14th, 2006, 10:45 AM
that is why i expanded his code in his other entry



_root.createEmptyMovieClip("square", 0), i=0;
//1
square.beginFill(0x0);
//2
square.moveTo(-5, -5);
//3
square.lineTo(-5, -5);
//4
square.lineTo(-5, 5);
//5
square.lineTo(5, 5);
//6
square.lineTo(5, -5);
//7
square.endFill();
//8
square._x = Stage.width/2;
//9
square._y = Stage.height/2;
//10
function create() {
square.duplicateMovieClip("explode"+[++i], _root.getNextHighestDepth(), {_x:stage.width/2, _y:stage.height/2, clr:"0x"+random(999999), _rotation:random(359), dir:random(10)+5, onEnterFrame:function () {
//11
var cl:Color = new Color(this);
//12
this._xscale=this._yscale -= 1, cl.setRGB(this.clr);
//13
this._x += Math.sin(this._rotation*(Math.PI/180))*this.dir;
//14
this._y -= Math.cos(this._rotation*(Math.PI/180))*this.dir;
//15
this._alpha -= 1.5;
//16
this._xscale = this._yscale += random(10);
//17
this._alpha<5 ? this.removeMovieClip() : this._alpha -= 3;
//18
}});
}
setInterval(create, 20);
//19


ohh, and i like to number them :P