Forum Topic: AS: FireWorks ;)

(3,601 views • 57 replies)

This topic is 2 pages long. [ 1 | 2 ]

<< < > >>
None

Inglor

Reply To Post Reply & Quote

Posted at: 7/23/05 05:01 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

This is my AS code for fireworks, PLEASE POST MODS FOR IT!!!!

This uses:
Duplicated MovieClips Basic API Functions Basic Math

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
trace(ref._x+","+ref._y+","+ref);
}
function explode(ref) {
for (i=0; i<40; i++) {
ref["boom"+i].delay = 11;
ref["boom"+i]._rotation = random(30)-15;
ref["boom"+i]._x+=random(50)-25;
ref["boom"+i]._y-=random(50)-25;
ref._rotation=0;
rot = ref["boom"+i]._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref["boom"+i].rot = rot;
ref["boom"+i].onEnterFrame = function() {
this._alpha=random(40)+50+this.delay*3;
if (this.delay>0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x += Math.sin((this.rot/180)*Math.PI)*this.dela
y;
} else if (this.delay<0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x -= Math.sin((this.rot/180)*Math.PI)*this.dela
y/3;
if(this.delay<-20){

removeMovieClip(this._parent);
delete this.onEnterFrame;
}
}
this.delay--;
trace(this._x);
};
}
ref.delay--;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, random(Math.pow(2, 24)), 100);
ref["boom"+i]._alpha = i*(100/40);
ref["boom"+i].moveTo(i, 0);
ref["boom"+i].lineTo(i+1, 1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 20;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
explode(ref);
} else {
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter=_root.counter%6 + 1;
};
Mouse.addListener(b);


None

Katocan

Reply To Post Reply & Quote

Posted at: 7/23/05 05:02 PM

Katocan LIGHT LEVEL 19

Sign-Up: 05/24/04

Posts: 668

very cool


None

jkhkhj

Reply To Post Reply & Quote

Posted at: 7/23/05 05:03 PM

jkhkhj NEUTRAL LEVEL 01

Sign-Up: 08/22/03

Posts: 192

That's teh sex. But you might want to explain it for the noobs.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/23/05 05:04 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

You are presuming I care about n00bs in the effects tutorials... bad presumption :P

this one is like denvish's starfield, if you don't understand it don't fuck with it, if you do it'll teach you a thing or 2


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/23/05 05:07 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948


None

btriangle

Reply To Post Reply & Quote

Posted at: 7/23/05 05:19 PM

btriangle LIGHT LEVEL 14

Sign-Up: 06/28/05

Posts: 1,111

i dont even get it, cause i dont have fireworks but i know what itt does


None

KaynSlamdyke

Reply To Post Reply & Quote

Posted at: 7/23/05 05:20 PM

KaynSlamdyke LIGHT LEVEL 16

Sign-Up: 06/25/04

Posts: 4,926

It's pretty and all Ing. Couldn't get it to do much else unfortunately (my grasp of AS is strictly in the fundamentals and the intermediates at the moment), although I did get it to spawn from a random position every time a firework finished detonating from a random x position, from a fixed spot on the y axis. Nothing impressive of course, and couldn't work out multiple fireworks from the same system.

Current build for ThreedeeTiles : Monkey
Previous: Lamprey, Mountain Goat (Dead Fork)


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/23/05 05:21 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948


None

Denvish

Reply To Post Reply & Quote

Posted at: 7/23/05 05:59 PM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,229

I actually posted a fireworks script in the API thread while ago... it doesn't have the rocket, but the particles are more sparkly =)
Copy/paste job:

Quick firework-style script. Click background to generate.

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

SW=Stage.width; SH=Stage.height; f=100;
C1=new Array("0xFF0000", "0xFFFFFF", "0xFFFF00", "0xFF9900", "0xFFCC33", "0xFFFFFF")

function makespark(rd){
_root.createEmptyMovieClip("spark", -7000);
with(spark){
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rd);
curveTo(rd*1.5, 0, 0, rd);
curveTo(-rd*1.5, 0, 0, -rd);
endFill();
_visible=0;
}
}

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

back.onPress=function(){
f+= numsparks+10;
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(400)-200)/35);
_root["spark"+z].vy= ((random(200)-150)/35);

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

makeback()
makespark(sparksize)

RESULT

- - Flash - Music - Images - -

BBS Signature

None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 7/23/05 06:24 PM

Glaiel-Gamer NEUTRAL LEVEL 28

Sign-Up: 12/28/04

Posts: 8,069

I like denvish's better, but it's just that it's a bit too square.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 08:21 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

At 7/23/05 05:59 PM, Denvish wrote:
Quick firework-style script. Click background to generate.

yeah, I've already seen this (in your new game)... still very nice sparkewise... I still think the fireworks in shoot for the sky pwn us.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 08:35 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
trace(ref._x+","+ref._y+","+ref);
}
function explode(ref) {
for (i=0; i<40; i++) {
ref["boom"+i].delay = 11;
ref["boom"+i]._rotation = random(30)-15;
ref["boom"+i]._x+=random(50)-25;
ref["boom"+i]._y-=random(50)-25;
ref._rotation=0;
rot = ref["boom"+i]._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref["boom"+i].rot = rot;
ref["boom"+i].onEnterFrame = function() {
this._alpha=random(40)+50+this.delay*3;
if (this.delay>0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x += Math.sin((this.rot/180)*Math.PI)*this.dela
y;
} else if (this.delay<0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x -= Math.sin((this.rot/180)*Math.PI)*this.dela
y/3;
if(this.delay<-20){

removeMovieClip(this._parent);
delete this.onEnterFrame;
}
}
this.delay--;
trace(this._x);
};
}
ref.delay--;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3,0xFFFFFF, 100);
ref["boom"+i]._alpha = i*(100/80) - 20;
ref["boom"+i].onEnterFrame=function(){
this._alpha+=2;
}
ref["boom"+i].moveTo(i, 0);
ref["boom"+i].lineTo(i+1, 1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 25;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
explode(ref);
} else {
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter=_root.counter%6 + 1;
};
Mouse.addListener(b);

white only MOD


None

Kipling

Reply To Post Reply & Quote

Posted at: 7/24/05 08:38 AM

Kipling NEUTRAL LEVEL 13

Sign-Up: 05/04/04

Posts: 2,641

At 7/23/05 05:19 PM, btriangle wrote: i dont even get it, cause i dont have fireworks but i know what itt does

lol, you obviously don't. It's a script for making fireworks. Not actionscript for Fireworks the programme. Silly kid.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 08:50 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function explode(ref) {
for (i=0; i<40; i++) {
ref["boom"+i].delay=11;
ref["boom"+i]._rotation = random(30)-15;
ref["boom"+i]._x += random(50)-25;
ref["boom"+i]._y -= random(50)-25;
ref._rotation = 0;
rot = ref["boom"+i]._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref["boom"+i].rot = rot;
ref["boom"+i].onEnterFrame = function() {
this._alpha = random(40)+50+this.delay*3;
if (this.delay>0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x += Math.sin((this.rot/180)*Math.PI)*this.dela
y;
} else if (this.delay<0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
y;
this._x -= Math.sin((this.rot/180)*Math.PI)*this.dela
y/3;
if (this.delay<-20) {
removeMovieClip(this._parent);
delete this.onEnterFrame;
}
}
this.delay--;
};
}

ref.onEnterFrame = function() {
this.createEmptyMovieClip("lol",12);
ref.lol.moveTo(this.boom1._x,this.boom1._y
);
for (i=1; i<39; i++) {
this.lol.lineStyle(.2, random(Math.pow(2,24)), random(50)+50);
this.lol.lineTo(this["boom"+i]._x, this["boom"+i]._y);
}
};
ref.delay--;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, random(Math.pow(2,24)), 100);
ref["boom"+i]._alpha = i*(100/80)-20;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(i, 0);
ref["boom"+i].lineTo(i+1, 1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 25;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
explode(ref);
} else {
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);

worst mod ever :(


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 09:02 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

Denvish+Inglor = pwn

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, random(Math.pow(2,16))<<16, 100);
ref["boom"+i]._alpha = i*(100/80)-20;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(i, 0);
ref["boom"+i].lineTo(i+1, 1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 25;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
} else {
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);

//Denvish ext Recommend 20 to 25 FPS
gravity=70;
numsparks=90;
sparksize=2;

SW=Stage.width; SH=Stage.height; f=90;
C1=new Array("0xFF0000", "0xFFFFFF", "0xFFFF00", "0xFF9900", "0xFFCC33", "0xFFFFFF")

function makespark(prd){
_root.createEmptyMovieClip("spark", -7000);
with(spark){
rd=prd;
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible=0;
}
}

function fddd(ref){
f+= numsparks+10;
for(z=f; z<(f+numsparks); z++){
duplicateMovieClip("spark", "spark"+z, z)
with(_root["spark"+z]){
_x=ref._x;
_y=ref._y;
}
_root["spark"+z].vx= ((random(400)-200)/25);
_root["spark"+z].vy= ((random(200)-150)/25);

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


None

DBarbarian

Reply To Post Reply & Quote

Posted at: 7/24/05 11:25 AM

DBarbarian NEUTRAL LEVEL 06

Sign-Up: 07/22/03

Posts: 69

Here you go.
I would still not recommend doing everything in AS. It is way too slow.

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}

function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, random(Math.pow(2, 16)) << 16, 100);
ref["boom"+i]._alpha = (100)/i+5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 25;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);

//Denvish ext Recommend 20 to 25 FP
gravity = 1.3;
numsparks = 90;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array() //Particle Array
_root.depth = 10000001;
C1 = new Array("0xFF0000", "0xFFFFFF", "0xFFFF00", "0xFF9900", "0xFFCC33", "0xFFFFFF");

function fddd(ref) {
f += numsparks+10;

_root.createEmptyMovieClip("sparkContainer
"+_root.depth,_root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;

cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}

for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc; //_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]); //ads it to the particle array
}
}

_root.createEmptyMovieClip("enterFrameList
ner",1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {

var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i,1); //remove it from the array
}

var container = n.cont;

i--;
}
container._y+=_root.gravity;
for(qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
}


None

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 11:43 AM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function explode(ref) {
for (i=0; i<40; i++) {
ref["boom"+i].delay = 11;
ref["boom"+i]._rotation = random(30)-15;
ref["boom"+i]._x += random(50)-25;
ref["boom"+i]._y -= random(50)-25;
ref._rotation = 0;
rot = ref["boom"+i]._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref["boom"+i].rot = rot;
ref["boom"+i].onEnterFrame = function() {
this._alpha = random(40)+50+this.delay*3;
if (this.delay>0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
;
y;
this._x += Math.sin((this.rot/180)*Math.PI)*this.dela
;
y;
} else if (this.delay<0) {
this._y -= Math.cos((this.rot/180)*Math.PI)*this.dela
;
y;
this._x -= Math.sin((this.rot/180)*Math.PI)*this.dela
;
y/3;
if (this.delay<-20) {
removeMovieClip(this._parent);
delete this.onEnterFrame;
}
}
this.delay--;
};
}
ref.delay--;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, random(Math.pow(2, 24)), 100);
ref["boom"+i]._alpha = i*(100/40);
ref["boom"+i].moveTo(i, 0);
ref["boom"+i].lineTo(i+1, 1);
}
ref._y = 400;
ref._x = _root._xmouse;
ref.delay = random(15)+15;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
explode(ref);
} else {
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);

Meh.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 11:49 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}

function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFFFFFF, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = 25;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);

//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array() //Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFFFFF","0xAAAAAA","0x555555");

function fddd(ref) {
f += numsparks+10;

_root.createEmptyMovieClip("sparkContainer
"+_root.depth,_root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;

cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}

for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc; //_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]); //ads it to the particle array
}
}

_root.createEmptyMovieClip("enterFrameList
ner",1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {

var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i,1); //remove it from the array
}

var container = n.cont;

i--;
}
container._y+=_root.gravity;
for(qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
}

black&white mod, improved cracker too


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 11:51 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

At 7/24/05 11:43 AM, -liam- wrote: Meh.

you just randomized the length, and the particles don't drop down now.


None

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 12:01 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

At 7/24/05 11:51 AM, Inglor wrote: you just randomized the length, and the particles don't drop down now.

Random length is good.

_quality="medium"
function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFFFFFF, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = _root._ymouse;
ref._x = _root._xmouse;
ref.delay = random(15)+15;
ref._rotation = 250+random(40);
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);
//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array();
//Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFFFFF", "0xAAAAAA", "0x555555");
function fddd(ref) {
f += numsparks+10;
_root.createEmptyMovieClip("sparkContainer
"+_root.depth, _root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;
cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}
for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc;
//_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]);
//ads it to the particle array
}
}
_root.createEmptyMovieClip("enterFrameList
ner", 1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {
var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i, 1);
//remove it from the array
}
var container = n.cont;
i--;
}
container._y += _root.gravity;
for (qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
};


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 12:06 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

if you're gonna make it random, make the direction random, not the length.


None

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 12:40 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

Ultimate. Firework. Mod.

_quality = "medium";
_root.createEmptyMovieClip("backGround", -10000);
with (backGround) {
lineStyle(1, 0x000000, 0);
beginFill(0x000033, 100);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
}
_root.createEmptyMovieClip("ground", -10001);
with (backGround) {
moveTo(0, 360);
beginFill(0x351100, 100);
lineStyle(5, 0x003300, 100);
lineTo(550, 360);
lineStyle(2, 0x000000, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 360);
}
function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFC0361, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = 370;
ref._x = _root._xmouse;
ref.delay = random(15)+15;
ref._rotation = random(180)+180;
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);
//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array();
//Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFCCFF", "0xFF00FF", "0xFF66FF");
function fddd(ref) {
f += numsparks+10;
_root.createEmptyMovieClip("sparkContainer
"+_root.depth, _root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;
cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFCCFF, 0);
beginFill(0xFFCCFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}
for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc;
//_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]);
//ads it to the particle array
}
}
_root.createEmptyMovieClip("enterFrameList
ner", 1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {
var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i, 1);
//remove it from the array
}
var container = n.cont;
i--;
}
container._y += _root.gravity;
for (qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
};


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 01:21 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

Patched :)

_quality = "medium";
shots=0;
_root.createEmptyMovieClip("backGround", -10000);
with (backGround) {
lineStyle(1, 0x000000, 0);
beginFill(0x000033, 100);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
}
_root.createTextField("text2", 7088, 20, 10, 490, 150);
_root.text2.type = "static";
_root.text2.setTextFormat(_root.t);
_root.text2.html = true;
_root.text2.htmlText = "<font COLOR='#FFFFFF'>Created by Inglor, Denvish, DBarbarian and Liam</font>";
_root.createTextField("text1", 6088, 20, 30, 490, 150);
_root.createEmptyMovieClip("ground", -10001);
text1.html=true;
text1.htmlText="<font COLOR='#FFFFFF'> Shots: 0";
with (backGround) {
moveTo(0, 360);
beginFill(0x351100, 100);
lineStyle(5, 0x003300, 100);
lineTo(550, 360);
lineStyle(2, 0x000000, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 360);
}
function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFC0361, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = 370;
ref._x = _root._xmouse;
ref.delay = random(5)+20;
ref._rotation = random(90)+235;
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
shots++;
text1.htmlText="<font COLOR='#FFFFFF'> Shots: "+shots;
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);
//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array();
//Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFCCFF", "0xFF00FF", "0x9900FF");
function fddd(ref) {
f += numsparks+10;
_root.createEmptyMovieClip("sparkContainer
"+_root.depth, _root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;
cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFCCFF, 0);
beginFill(0xFFCCFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}
for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc;
//_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]);
//ads it to the particle array
}
}
_root.createEmptyMovieClip("enterFrameList
ner", 1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {
var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i, 1);
//remove it from the array
}
var container = n.cont;
i--;
}
container._y += _root.gravity;
for (qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
};

I'm gonna add a BG now


Happy

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 01:34 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

At 7/24/05 01:21 PM, Inglor wrote: I'm gonna add a BG now

Schweet.

Add these two lines somewhere though;

_root.text2.selectable = false;
text1.selectable = false;

So that annoying line thing doesn't appear :)

I didn't even know you could do selectable=false.. god I learn something new every day.

None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 01:42 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

Modded to perfection :D

_quality = "medium";
shots = 0;
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
mc.moveTo(x+r, y);
mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
}
trace(bgHeights);
delete bgHeights;
_root.createEmptyMovieClip("backGround", -10000);
_root.createEmptyMovieClip("moon",-4000);
moon.beginFill(0xFFFFFF,90);
drawCircle(moon,450,40,26);
moon.endFill();
with (backGround) {
lineStyle(1, 0x000000, 0);
beginFill(0x000033, 100);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
bgHeights = new Array();
bgHeights.push(260);
for (d=0; d<11; d++) {
t = bgHeights[bgHeights.length-1];
t += random(50)-25;
if (t>360) {
t = 360;
}
bgHeights.push(t);
}
endFill();
beginFill(0x2F3528,100);
moveTo(0, bgHeights[1]);
lineStyle(4, 0xAAAAAA, 0);
for (i=0; i<bgHeights.length; i++) {
lineTo(i*55-55, bgHeights[i]);
}
lineTo(550,400);
lineTo(0,400);
endFill();
}
_root.createTextField("text2", 7088, 20, 10, 490, 50);
_root.text2.type = "static";
_root.text2.setTextFormat(_root.t);
_root.text2.html = true;
_root.text2.htmlText = "<font COLOR='#FFFFFF'>Created by Inglor, Denvish, DBarbarian and Liam</font>";
_root.createTextField("text1", 6088, 20, 30, 490, 50);
_root.createEmptyMovieClip("ground", -10001);
text1.html = true;
text1.htmlText = "<font COLOR='#FFFFFF'> Shots: 0";
with (backGround) {
moveTo(0, 360);
beginFill(0x351100, 100);
lineStyle(5, 0x003300, 100);
lineTo(550, 360);
lineStyle(2, 0x000000, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 360);
}
function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFC0361, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = 370;
ref._x = _root._xmouse;
ref.delay = random(5)+20;
ref._rotation = random(90)+235;
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
shots++;
text1.htmlText = "<font COLOR='#FFFFFF'> Shots: "+shots;
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);
//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array();
//Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFCCFF", "0xFF00FF", "0x9900FF");
function fddd(ref) {
f += numsparks+10;
_root.createEmptyMovieClip("sparkContainer
"+_root.depth, _root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;
cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFCCFF, 0);
beginFill(0xFFCCFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}
for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc;
//_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]);
//ads it to the particle array
}
}
_root.createEmptyMovieClip("enterFrameList
ner", 1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {
var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i, 1);
//remove it from the array
}
var container = n.cont;
i--;
}
container._y += _root.gravity;
for (qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
};


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 01:44 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

http://img285.images..age=untitled69rs.swf

here is the demo, I left it as a link because I found the title "untitled69res" funny.


None

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 01:50 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

At 7/24/05 01:44 PM, Inglor wrote: here is the demo, I left it as a link because I found the title "untitled69res" funny.

_quality = "medium";
shots = 0;
function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void {
mc.moveTo(x+r, y);
mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x, Math.sin(Math.PI/4)*r+y);
mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x, -Math.sin(Math.PI/4)*r+y);
mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);
}
delete bgHeights;
_root.createEmptyMovieClip("backGround", -10000);
_root.createEmptyMovieClip("moon", -4000);
moon.beginFill(0xFFFFFF, 90);
drawCircle(moon, 450, 40, 26);
moon.endFill();
with (backGround) {
lineStyle(1, 0x000000, 0);
beginFill(0x000033, 100);
lineTo(550, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 0);
bgHeights = new Array();
bgHeights.push(260);
for (d=0; d<11; d++) {
t = bgHeights[bgHeights.length-1];
t += random(50)-25;
if (t>360) {
t = 360;
}
bgHeights.push(t);
}
endFill();
beginFill(0x2F3528, 100);
moveTo(0, bgHeights[1]);
lineStyle(4, 0xAAAAAA, 0);
for (i=0; i<bgHeights.length; i++) {
lineTo(i*55-55, bgHeights[i]);
}
lineTo(550, 400);
lineTo(0, 400);
endFill();
}
_root.createTextField("text2", 7088, 20, 10, 490, 50);
_root.text2.type = "static";
_root.text2.setTextFormat(_root.t);
_root.text2.html = true;
_root.text2.htmlText = "<font COLOR='#FFFFFF'>Created by Inglor, Denvish, DBarbarian and Liam</font>";
_root.createTextField("text1", 6088, 20, 30, 490, 50);
_root.createEmptyMovieClip("ground", -10001);
text1.html = true;
text1.htmlText = "<font COLOR='#FFFFFF'> Shots: 0";
_root.text2.selectable = false;
text1.selectable = false;
with (backGround) {
moveTo(0, 360);
beginFill(0x351100, 100);
lineStyle(5, 0x003300, 100);
lineTo(550, 360);
lineStyle(2, 0x000000, 0);
lineTo(550, 400);
lineTo(0, 400);
lineTo(0, 360);
}
function phase1(ref) {
ref.delay--;
rot = ref._rotation;
if ((rot<0) && (rot>-180)) {
rot *= -1;
} else if (rot>0) {
rot = 180-rot;
rot += 180;
}
ref._y -= Math.sin((rot/180)*Math.PI)*ref.delay;
ref._x += Math.cos((rot/180)*Math.PI)*ref.delay;
}
function generate(ref) {
for (i=0; i<40; i++) {
ref.createEmptyMovieClip("boom"+i, i*2);
ref["boom"+i].lineStyle(3, 0xFC0361, 100);
ref["boom"+i]._alpha = (100)/i-5;
ref["boom"+i].onEnterFrame = function() {
this._alpha += 2;
};
ref["boom"+i].moveTo(-i, 0);
ref["boom"+i].lineTo(-i-1, -1);
}
ref._y = 370;
ref._x = _root._xmouse;
ref.delay = random(5)+20;
ref._rotation = random(90)+235;
ref.onEnterFrame = function() {
if (ref.delay>7) {
phase1(ref);
} else if (ref.delay == 7) {
//explode(ref);
fddd(ref);
removeMovieClip(ref);
delete ref.onEnterFrame;
}
};
}
_root.counter = 0;
b = new Object();
b.onMouseDown = function() {
shots++;
text1.htmlText = "<font COLOR='#FFFFFF'> Shots: "+shots;
_root.createEmptyMovieClip("a"+_root.count
er, _root.counter);
generate(_root["a"+_root.counter]);
_root.counter = _root.counter%6+1;
};
Mouse.addListener(b);
//Denvish ext Recommend 20 to 25 FP
gravity = 1.4;
numsparks = 120;
sparksize = 2;
SW = Stage.width;
SH = Stage.height;
f = 90;
_root.rc = Math.PI/180;
_root.pa = new Array();
//Particle Array
_root.depth = 10000001;
C1 = new Array("0xFFCCFF", "0xFF00FF", "0x9900FF");
function fddd(ref) {
f += numsparks+10;
_root.createEmptyMovieClip("sparkContainer
"+_root.depth, _root.depth);
var cont = _root["sparkContainer"+_root.depth];
_root.depth++;
cont.createEmptyMovieClip("spark", -7000);
with (cont.spark) {
rd = _root.sparksize;
lineStyle(0, 0xFFCCFF, 0);
beginFill(0xFFCCFF);
moveTo(0, -rd);
curveTo(rd*2.5, 0, 0, rd);
curveTo(-rd*2.5, 0, 0, -rd);
endFill();
_visible = 0;
}
for (z=f; z<(f+numsparks); z++) {
cont.spark.duplicateMovieClip("spark"+z, z);
with (cont["spark"+z]) {
_x = ref._x;
_y = ref._y;
}
var r = random(100)+10;
var rot = random(360)*_root.rc;
//_root.rc = Math.PI/180
cont["spark"+z].dx = ref._x+r*Math.cos(rot);
cont["spark"+z].dy = ref._y+r*Math.sin(rot);
cont["spark"+z].cont = cont;
_root.pa.push(cont["spark"+z]);
//ads it to the particle array
}
}
_root.createEmptyMovieClip("enterFrameList
ner", 1000000);
_root.enterFrameListner.onEnterFrame = function() {
if (_root.pa.length>0) {
var i = _root.pa.length-1;
while (i>=0) {
var n = _root.pa[i];
new Color(n).setRGB(C1[random(C1.length)]);
n._x += (n.dx-n._x)/12;
n._y += (n.dy-n._y)/12;
n._xscale -= 2;
n._yscale = n._xscale;
if (n._y>SH || n._xscale<0) {
n.removeMovieClip();
_root.pa.splice(i, 1);
//remove it from the array
}
var container = n.cont;
i--;
}
container._y += _root.gravity;
for (qwe in container) {
container.count++;
}
if (container.count == undefined) {
container.removeMovieClip();
}
}
};

Just changed the text thingie.. anyway, I think that would good with a starry background.. then submitted as an alt. Hmm.

http://img337.images..age=fireworks7sj.swf


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 01:54 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

sure, just add some content, like you have to shoot fireworks at falling objects, that would be cool, an actual API game, don't forget to coauth my alt! (denvish's alt too if he is interested)

add the background, the falling objects you shoot, a score box, and it'll be a pretty nice game :)

if you submit remmember saying it's api


None

liaaaam

Reply To Post Reply & Quote

Posted at: 7/24/05 01:57 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,541

At 7/24/05 01:54 PM, Inglor wrote: add the background, the falling objects you shoot, a score box, and it'll be a pretty nice game :)

I will do.

if you submit remmember saying it's api

Yah, or else people will probably blam because of the file size.


None

Inglor

Reply To Post Reply & Quote

Posted at: 7/24/05 02:06 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

cool, if you need any shorties scripted about this feel free to ask


All times are Eastern Standard Time (GMT -5) | Current Time: 12:22 AM

<< Back

This topic is 2 pages long. [ 1 | 2 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!