The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Page 1 of 2 12 LastLast
Results 1 to 15 of 21

Thread: [DBarbarian Entry 1] - Fireworks

  1. #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.
    this.headA = new Array();
    this.drawCircle = function(col,siz,x,y,d) {
    	this.createEmptyMovieClip("c"+d,d)._x = x;
    	this["c"+d]._y = y;
    	return this["c"+d];
    this.removeParticle = function(n,ind) {
    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"]);
    		} else if (this.headA[i][5] == "head2" and this.headA[i][0].clicks++>20+random(15)) {
    		} else if (this.headA[i][5] == "trail" and this.headA[i][2]-this.headA[i][0]._y<2) {
    		(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);
    *NOTE: Do not click too many times. I recommend having 2 fireworks onscreen at one time.

    ****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.
    Attached Files Attached Files
    Last edited by dbarbarian; January 14th, 2006 at 12:55 PM.

  2. #2
    cool, but if one clicks it too many times, it lags a lot.

  3. #3
    Thanks. I added a note on there.

  4. #4
    icio's Avatar
    looks better in lowercase
    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.

  5. #5

    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.

  6. #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

  7. #7
    icio's Avatar
    looks better in lowercase
    Oh yeah, that is strange.

    Nice effect
    "60% of the time it works... every time." -- Paul Rudd as Brian Fantana.

  8. #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

  9. #9
    pretty nice effect! but it is pretty cpu intensive

  10. #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.

    You know 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.

  11. #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!

  12. #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.

  13. #13
    Very nice, but if you click to much it lags
    Member #2 of the "I wont critique Timmytot's designs anymore" club.

  14. #14
    phorte's Avatar
    formerly aussie devil
    wicked stuff..

  15. #15
    McGiver's Avatar
    ibm good, lenovo bad
    wow, this is cool.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012