Results 1 to 15 of 21
Thread: [DBarbarian Entry 1] - Fireworks
Hybrid View
-
January 13th, 2006, 04:12 PM #1
[DBarbarian Entry 1] - Fireworks
I made two versions. One regular and one rainbow.
Let me know which one you like better, because I can't decide.
The rainbow code is the same as this one, but with different color settings.
EDIT: This code should be legal.
*NOTE: Do not click too many times. I recommend having 2 fireworks onscreen at one time.Code:this.headA = new Array(); this.drawCircle = function(col,siz,x,y,d) { this.createEmptyMovieClip("c"+d,d)._x = x; this["c"+d]._y = y; this["c"+d].lineStyle(siz,col,100); this["c"+d].lineTo(1,0); return this["c"+d]; } this.removeParticle = function(n,ind) { n.removeMovieClip(); this.headA.splice(ind,1); } this.onEnterFrame = function() { for (i in this.headA) { this.headA[i][0]._x += (this.headA[i][5]!="head2") ? this.headA[i][3]:(this.headA[i][1]-this.headA[i][0]._x)/8; this.headA[i][0]._y += (this.headA[i][5]!="head2") ? this.headA[i][4]:(this.headA[i][2]-this.headA[i][0]._y)/8; this.headA[i][0]._xscale = this.headA[i][0]._yscale = (80+random(70)-35); this.headA[i][2] += (this.headA[i][5]=="head2") ? 2:0; col = new Color(this.headA[i][0]).setRGB("0xFFFF"+((random(2)==0) ? "FF":((random(2)==0) ? "CC":"99"))); if (this.headA[i][5] == "head" and (this.headA[i][0]._x-this.headA[i][1])*(this.headA[i][0]._x-this.headA[i][1])+(this.headA[i][0]._y-this.headA[i][2])*(this.headA[i][0]._y-this.headA[i][2])<100) { for(j=0; j<16; j++) { this.headA.push([this.drawCircle("0xFFFFFF",5,this.headA[i][0]._x,this.headA[i][0]._y,this.d++),this.headA[i][0]._x+((j<8) ? (random(20)+100):(random(10)+55))*Math.cos(j*Math.PI/4+Math.random()*Math.PI/8),this.headA[i][0]._y+((j<8) ? (random(20)+100):(random(10)+55))*Math.sin(j*Math.PI/4+Math.random()*Math.PI/8),0,0,"head2"]); } this.removeParticle(this.headA[i][0],i); } else if (this.headA[i][5] == "head2" and this.headA[i][0].clicks++>20+random(15)) { this.removeParticle(this.headA[i][0],i); } else if (this.headA[i][5] == "trail" and this.headA[i][2]-this.headA[i][0]._y<2) { this.removeParticle(this.headA[i][0],i); } (this.headA[i][5]!="trail" and random(2)==0) ? this.headA.push([this.drawCircle("0xFFFFFF",2,this.headA[i][0]._x+random(8)-4,this.headA[i][0]._y+random(8)-4,this.d++),this.headA[i][0]._x,this.headA[i][0]._y+random(20)+5,0,1,"trail"]):0; } } this.onMouseDown = function() { this.tempx = random(400); this.headA.push([this.drawCircle("0xFFFFFF",5,this.tempx,415,this.d++),this._xmouse,this._ymouse,7*Math.cos(Math.atan2(this._ymouse-415,this._xmouse-this.tempx)),7*Math.sin(Math.atan2(this._ymouse-415,this._xmouse-this.tempx)),"head"]); }
http://dounanthebarb.tripod.com/Kiru...Fireworks.html
http://dounanthebarb.tripod.com/Kiru...Fireworks.html
****NOTE 2*******
Do NOT view the swf file below. For some strange reason, the particles are not removed. The html files are working correctly though.Last edited by dbarbarian; January 14th, 2006 at 11:55 AM.
-
January 13th, 2006, 04:20 PM #2
cool, but if one clicks it too many times, it lags a lot.

"HEY!"
"YEAH!"
"WHAT?!"
"OKAY!"
"LET'S GO..." - Lil Jon.
-
January 13th, 2006, 04:24 PM #3
Thanks. I added a note on there.
-
January 13th, 2006, 05:16 PM #4
It's unfortunate that you don't have enough lines to remove the particles too, that would be the icing on the cake
- it's a very nice effect
"60% of the time it works... every time." -- Paul Rudd as Brian Fantana.
-
January 13th, 2006, 05:50 PM #5
Thanks.
I do remove the particles, but for some reason the swf files that I uploaded don't do it. Weird.
The swf work fine on my harddrive, or when I copy and paste the code. But once it's uploaded onto here, the particles aren't removed.
View the html files, those are working properly.
-
January 13th, 2006, 06:10 PM #6
lovely. I was planning on some fireworks too.
Remove the random colors and put some life to it like changing from yellow to red and then fade out. I like this anyway. When it's small it looks really good
.
...lurking around
-
January 13th, 2006, 06:28 PM #7
Oh yeah, that is strange.

Nice effect
"60% of the time it works... every time." -- Paul Rudd as Brian Fantana.
-
January 13th, 2006, 06:53 PM #8
I had to try it call me a kid, but I clicked hella times.....almost brought my computer to its knees. Nice effect tho.
shane-c....Your site is a lot like a transvestite in that respect.
fester8542.I'd hit it like the fist of an angry God .
JoshuaJonah.I design for DDD. Then clients usually like it, and the ladies find me more attractive.
Cybercode Albert Einstein Said that my math teacher has that on his wall
K-Emmys-06: Best "Best Mod" K-Emmys-06: Best "Most Creative Critic"
Member #1 of the "I wont critique Timmytot's designs anymore" club
-
January 14th, 2006, 12:47 AM #96,170iAm t3h hybrid
postspretty nice effect! but it is pretty cpu intensive
-
January 14th, 2006, 02:14 AM #10
virusecu: I can't think of a one line way to make the particles fade colors and alpha. I'll see if I can compress the code some and I might be able to squeeze it in there. Thanks for the input

icio: Thank you. It's a weird problem. It happened to my third submission too, the snake game. Except there, instead of not remove objects, nothing shows up at all except the background. My coding must be soo bad that this site can't process it.
DDD: lol. Thanks.
hybrid101: Yea. That's what happens when you have a lot of particles looping around. I tried it with less particles, but it just doesn't look as good. I have a much better fireworks experiment that implemented tweens so the little particles didn't need to be pushed into arrays, so I could have a lot more particles on screen. But I would rather not post the link right now as this current one pales in comparison, and I would rather not make my entry look worse than it already is.

EDIT:
You know what...it actually looks pretty cool when it's small and the particles aren't removed. Kinda looks like your creating palm trees. Odd colored palm trees, but trees nonetheless.
-
January 14th, 2006, 04:42 AM #11
Nice, but the coloured one looks a bit too colourful to me. I'll probably like it more if the colours changed less but it's still funky!
nokrev on Adobe and Macromedia:
With the merger, these two great technologies will be merging.
nokrev on this footer:
I love seeing Sinister Shadow's footer.
-
January 14th, 2006, 12:02 PM #12
Thanks sinister.
Here is the original fireworks experiment in case anyone would like to see it. Use 1,2,3,4,5 to shoot different fireworks.
Warning: tripod hosting.
http://dounanthebarb.tripod.com/Work/centfireworks.html
-
January 14th, 2006, 12:35 PM #13
Very nice, but if you click to much it lags
Member #2 of the "I wont critique Timmytot's designs anymore" club.
-
January 14th, 2006, 07:08 PM #14
wicked stuff..
-
January 15th, 2006, 05:51 AM #15
wow, this is cool.
Those who would sacrifice freedom for security will get neither
Similar Threads
-
the "l33tz0r omg pwnage" entry
By ya3 in forum 25 Line AS ContestReplies: 12Last Post: February 4th, 2006, 06:55 AM -
Creating Fireworks
By MrLucky in forum Flash IDEReplies: 1Last Post: December 30th, 2005, 01:55 PM -
treatkor's entry
By treatkor in forum Footer Contest #2Replies: 14Last Post: July 6th, 2005, 03:57 PM -
Entry #1 Colombianking
By colombianking in forum Footer Contest #2Replies: 15Last Post: July 6th, 2005, 03:20 PM -
entry no.1
By farsite in forum Footer Contest #2Replies: 9Last Post: July 4th, 2005, 04:18 PM

Reply With Quote

Bookmarks