PDA

View Full Version : square shower..



nathan99
January 16th, 2006, 01:14 AM
My second entry..



l = f=0;
function create(x, y, w, h, c) {
var k = _root.createEmptyMovieClip("square"+[++l], l);
k.beginFill(c);
k.moveTo(-(w/2), -(h/2));
k.lineTo(-(w/2), -(h/2));
k.lineTo(-(w/2), h/2);
k.lineTo(w/2, h/2);
k.lineTo(w/2, -(h/2));
k._y = x;
k._x = y;
}
setInterval(function () {
for (var i = 0; i<2; i++) {
square1.duplicateMovieClip("nesq"+[++f], getNextHighestDepth(), {_x:square1._x+random(10), _rotation:random(360), dir:random(2), _alpha:random(50)+50, xsp:Math.random()*5, ysp:-Math.random()*20-10, onEnterFrame:function () {
this.dir == 1 ? this._x -= this.xsp : this._x += this.xsp;
this._y>Stage.height ? this.removeMovieClip() : this._y += this.ysp;
!this.hitTest(square2) && !this.hitTest(square3) ? this.ysp++ : null;
while (this.hitTest(square2) || this.hitTest(square3)) {
this._y--;
}
}});
}
}, 10);
create(Stage.height, Stage.width/2, 4, 4, "0xEE0000");
create(Stage.height/1.4, 350, 60, 20, "0x000000");
create(Stage.height/1.4, 175, 60, 20, "0x000000");

jerez_z
January 16th, 2006, 01:50 AM
very nice

Barcadia
January 16th, 2006, 05:24 AM
its very square

nathan99
January 16th, 2006, 08:00 AM
its very square

hence the title.

Seb Hughes
January 16th, 2006, 11:56 AM
Wow that is very swanky indeed :D

great
January 17th, 2008, 11:05 AM
Great one. I like it.

npgames
January 22nd, 2008, 11:52 PM
spam?

Templarian
January 24th, 2008, 10:49 PM
Yes... lets bann nick p. for spamming.

npgames
January 25th, 2008, 12:08 AM
hahaha, lets not, i got bored of the Banned title, too many people thought i was realy banned, and besides id never get my server up if i was banned

alexgeek
January 25th, 2008, 04:47 PM
That's awesome!

biznuge
January 28th, 2008, 09:23 AM
think the pellets that hit the little shelves need to have their vertical speed reset once they hit that thing, as they seem to fly off the end at too high a speed...

Nice though.