00:00
00:00
Newgrounds Background Image Theme

SpeakyDooman just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS: FireWorks ;)

8,900 Views | 57 Replies
New Topic Respond to this Topic

Response to AS: FireWorks ;) 2005-07-24 14:11:50


suggestions:

1)draw a launcher
2)fireworks always shoot from the center to the place the mouse is pointing at
3)add a costume aim instead of the mouse.

Response to AS: FireWorks ;) 2005-07-24 14:12:23


We should do a game collaberation whereby everyone adds 1 function or something...

Or is that what you are doing here?

I dunno...

Forget I said anything


- Matt, Rustyarcade.com

Response to AS: FireWorks ;) 2005-07-24 14:13:52


At 7/24/05 02:06 PM, Inglor wrote: cool, if you need any shorties scripted about this feel free to ask

Ok, can you do a random rock shape that is generated every 10 seconds?


Sup, bitches :)

BBS Signature

Response to AS: FireWorks ;) 2005-07-24 14:39:02


that's just an interval and 5 lineTos, you can do that faster then you can copy-paste it...

Response to AS: FireWorks ;) 2005-07-24 14:41:21


At 7/24/05 02:39 PM, InglorAntiPostLimit wrote: that's just an interval and 5 lineTos, you can do that faster then you can copy-paste it...

But can I?

Ok, I can.

¬¬


Sup, bitches :)

BBS Signature

Response to AS: FireWorks ;) 2005-07-24 15:44:48


the fireworks arent fireworky enough you should expand the radius and have a little bit of gravity so the result falls after it detonates

Response to AS: FireWorks ;) 2005-07-24 15:46:16


which version are you talking about? you realise that radius and gravity are both variables you can change, right?

Response to AS: FireWorks ;) 2005-07-24 15:53:49


At 7/24/05 03:46 PM, Inglor wrote: which version are you talking about? you realise that radius and gravity are both variables you can change, right?

Flash MX 2004 pro, I'm in intermedate script so i'm following barley but yea i know gravity and radius are varibels thats why i said add them when the fireworks detonate its in this small square real fireworks go randomly and fall before they fade out you should either draw up a bunch of paths or get a radom path generator

now i dont know which type of fireworks your going for but the orginal kind go in the kind of palm tree path

Response to AS: FireWorks ;) 2005-07-24 15:55:11


you still haven't stated what ver you're talking about, the last one?

Response to AS: FireWorks ;) 2005-07-24 15:59:27


At 7/24/05 03:55 PM, Inglor wrote: you still haven't stated what ver you're talking about, the last one?

im not sure what u mean but bigger raduis normal gravity read my post above

Response to AS: FireWorks ;) 2005-07-24 16:29:56


At 7/24/05 01:44 PM, Inglor wrote: Created by Inglor,Denvish,Liam,and DBarbarian.

Add this and count me in the list: >: | </ Sarcasm :P>

MakeFunPLZ = function()
{
createEmptyMovieClip("fun",1000);
fun.lineStyle(200,0xFFFFFF,100);
}
onMouseDown = function()
{
MakeFunPLZ();

fun.moveTo(_xmouse,_ymouse);
fun.lineTo(1000,1000);
fun.say:kthxbai!
}

Actually,I'm not satisfied with this code,I wanted it to be worse and look more idiotic : /


BBS Signature

Response to AS: FireWorks ;) 2005-07-24 16:36:45


changed it to

onMouseDown = function()
{
MakeFunPLZ();

fun.moveTo(_xmouse,_ymouse);
fun.lineTo(1000,1000);
}

now it works, still isn't very good :P

mod it seriusly and we'll credit j00

Response to AS: FireWorks ;) 2005-07-24 17:04:26


**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};

Total ActionScript Errors: 2 Reported Errors: 2

Well , that's not supposed to be happenung...

I tried fixing one of them, but it appears I ca't fix one withpout making it screw up somewhere else.

Using MX 2004 Pro.

Response to AS: FireWorks ;) 2005-07-24 17:14:45


At 7/24/05 05:04 PM, NuclearPop wrote: **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};

Total ActionScript Errors: 2 Reported Errors: 2

Well , that's not supposed to be happenung...

I tried fixing one of them, but it appears I ca't fix one withpout making it screw up somewhere else.

Using MX 2004 Pro.

if you copied and pasted it from here its because the length of the lines on the BBS is less then the ones in the actions panel meaning breaks are put in places where they are not supposed to be. Dont worry there should'nt be too many just have a quick scan through


- Matt, Rustyarcade.com

Response to AS: FireWorks ;) 2005-07-24 17:45:49


At 7/23/05 05:03 PM, The_BananaCock wrote: That's teh sex. But you might want to explain it for the noobs.

no its not

Response to AS: FireWorks ;) 2005-07-24 17:50:11


If Denvish wouldn't mind, I was using his code, and just by changing a few values around, I made pretty much a confetti gun... When you first click it fires really flast but the it slows down and drifts like smoke a bit. May I post the dited code?

Response to AS: FireWorks ;) 2005-07-24 17:58:10


of course you may, all mods appreciated

Response to AS: FireWorks ;) 2005-07-24 18:01:11


amazing!


BBS Signature

Response to AS: FireWorks ;) 2005-07-24 18:32:26


Here, there are 2 codes, one kinf of forces the effect... But here they are.

//Recommend 20 to 25 FPS
gravity=30;
numsparks=100;
sparksize=2;

SW=Stage.width; SH=Stage.height; f=100;
C1=new Array("0x1C11EE", "0x1C11EE", "2FA5D0", "0xF8F807", "0xFF2F6D", "0x5297DC")

function makespark(rd){
_root.createEmptyMovieClip("spark", -2000);
with(spark){
lineStyle(2, 0x44EA4B, 0);
beginFill(0x6240EE);
moveTo(0, -rd);
curveTo(rd*3, 2, 1, rd);
curveTo(-rd*5, 4, 3, -rd);
endFill();
_visible=2;
}
}

function makeback(){
_root.createEmptyMovieClip("back", 1);
with(back){
beginFill(0x456123, 100);
moveTo(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
lineTo(0, 0);
endFill();
}

back.onPress=function(){
f+= numsparks+500;
for(z=f; z<(f+numsparks); z++){
duplicateMovieClip("spark", "spark"+z, z)
with(_root["spark"+z]){
_x=_root._xmouse;
_y=_root._ymouse;
}
_root["spark"+z].vx= ((random(876)-900)/35);
_root["spark"+z].vy= ((random(300)-150)/35);

_root["spark"+z].onEnterFrame=function(){
new Color(this).setRGB(C1[random(C1.length)]);
this._x+=this.vx*4;
this._y+=this.vy*1.5;
this._alpha-=1;
down=random(gravity)/100;
this.vy+=down;
if(this._y>SH || this._alpha<0){
this.removeMovieClip();
}
}
}
}
}

makeback()
makespark(sparksize)

//Recommend 20 to 25 FPS
gravity=30;
numsparks=100;
sparksize=2;

SW=Stage.width; SH=Stage.height; f=100;
C1=new Array("0x1C11EE", "0x1C11EE", "2FA5D0", "0xF8F807", "0xFF2F6D", "0x5297DC")

function makespark(rd){
_root.createEmptyMovieClip("spark", -2000);
with(spark){
lineStyle(2, 0x44EA4B, 0);
beginFill(0x6240EE);
moveTo(0, -rd);
curveTo(rd*3, 2, 1, rd);
curveTo(-rd*5, 4, 3, -rd);
endFill();
_visible=2;
}
}

function makeback(){
_root.createEmptyMovieClip("back", 1);
with(back){
beginFill(0x456123, 100);
moveTo(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
lineTo(0, 0);
endFill();
}

back.onPress=function(){
f+= numsparks+500;
for(z=f; z<(f+numsparks); z++){
duplicateMovieClip("spark", "spark"+z, z)
with(_root["spark"+z]){
_x=_root._xmouse;
_y=_root._ymouse;
}
_root["spark"+z].vx= ((random(876)-900)/35);
_root["spark"+z].vy= ((random(300)-150)/35);

_root["spark"+z].onEnterFrame=function(){
new Color(this).setRGB(C1[random(C1.length)]);
this._x+=this.vx*12;
this._y+=this.vy*1.5;
this._alpha-=1;
down=random(gravity)/100;
this.vy+=down;
if(this._y>SH || this._alpha<0){
this.removeMovieClip();
}
}
}
}
}

makeback()
makespark(sparksize)

The bottom one really forces it, but it's kind of interesting anyways.

Response to AS: FireWorks ;) 2005-07-24 18:34:25


it's nice but it's kinda unbalanced if you know what I mean

Response to AS: FireWorks ;) 2005-07-24 18:43:30


Yeah, see, I'm terrible at editing actionscript, if you told me to make a sustom cursor I'd run away. :(

Response to AS: FireWorks ;) 2005-07-24 19:22:41


At 7/24/05 06:43 PM, NuclearPop wrote: Yeah, see, I'm terrible at editing actionscript, if you told me to make a sustom cursor I'd run away. :(

Heh. Just keep practicing. i never took any lessons or stuff, most of the stuff I know is learnt by the same method you're using: playing with public flas/code (and the occasional tutorial/reference to the Flash help files & AS Dictionary). So long as you're willing to learn, you're sorted.

As for the last fireworks script posted (by -liam-): I like the background and the rocket, but I think the particles should be smaller, more glittery, and have gravity take effect earlier. The gravity seems to 'pause' before it takes effect, which is not what happens with real fireworks; the particles start being affected by gravity as soon as they are expelled from the rocket. I'd analyse the code myself, but I'm a little busy with a couple of other API projects right now.


- - Flash - Music - Images - -

BBS Signature

Response to AS: FireWorks ;) 2005-07-25 17:48:15


Hey I am completly new at api (as a matter of fact I just started scripting in it yesterday, and I am really enjoying it)

well anyway I made three scripts:

script1 (circle fireworks):

w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = (15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
if (this.delay == 1) {
this._rotation = random(360);
} else {
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);

script 2 (vibrating):

w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = (15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
this._rotation = random(360);
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);

script 3(gyser):

w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = random(15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
this._rotation = random(360);
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);

hope you like tell me what you think of these

links to examples

(1)http://img91.imagesh..ge=fireworks16av.
swf

(2)http://img91.imagesh..ge=fireworks25kv.
swf

(3)http://img91.imagesh..ge=fireworks36mw.
swf

Response to AS: FireWorks ;) 2005-07-25 19:43:16


where do i type it? (Flash MX 2004)


Egotist, n. A person of low taste, more interested in himself than in me.

-Ambrose Bierce

"This sig, is fucking cool."

BBS Signature

Response to AS: FireWorks ;) 2005-07-25 19:46:30


At 7/25/05 05:48 PM, Disarray_yarrasiD wrote: Hey I am completly new at api (as a matter of fact I just started scripting in it yesterday, and I am really enjoying it)

very nice scripting/modding :) I am impressed, you have a bright future, gimme a ring

Response to AS: FireWorks ;) 2005-11-05 06:16:19


I would mod this a bit, but right now I haven't got any time


BBS Signature

Response to AS: FireWorks ;) 2006-07-12 19:48:58


wow, these are all very amusing. ^_^

How bout one that alternates fireworks?

Response to AS: FireWorks ;) 2006-08-03 11:04:38


It seems like a nice script and all, but like when I usually use scripts from threads, I always get errors, despite how other people have got on fine. This is what I get when check the syntax:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};

Total ActionScript Errors: 2 Reported Errors: 2

I could really use this API for my next Flash, so if anyone could help, it would be appreciated, I even tried editing it myself, but it made sense and everything to me, so I got nothing. :(