I was trying to make a sun with flames but am not sure how to approach this. thanks
Well, here is something I did for a contest but never submitted it :-\ I’ve messed up a bit too much with the code, so it doesn’t look like fire anymore, but maybe it can help you… Just put that in the first frame of your movie:
/************************
Function declarations
************************/
function oscillate(){
this.posx=100*this.i+this.radius*Math.sin(puls*dtr*(this.a+=.8)+this.z*dtr*80*Math.sin(this.rand+=this.z/10));
this.posz=50*this.z+this.flames*Math.sin(puls*dtr*(this.b+=.06)+this.z*dtr*20)*Math.random();
this.setPerspective();
}
MovieClip.prototype.setPerspective=function(){
this.scale=200/(this.posz+200);
this._x=(center.x-origin.x+this.posx)*this.scale+origin.x;
this._y=(center.y-origin.y+this.posy)*this.scale+origin.y;
}
/************************
Variables and elements
************************/
origin={x:250,y:400};
center={x:250,y:50};
cols=5;
rows=3;
prof=5;
puls=15;
dtr=Math.PI/180;
mc=_root.createEmptyMovieClip("rond",-1);
k=0;
for (var j=0; j < cols;j++){
for(var i=0;i < rows;i++){
for (var z=0;z < prof;z++){
myMc=rond.duplicateMovieClip("rond"+k,k++);
myMc.i=i;
myMc.j=j;
myMc.z=z;
myMc.radius=(5-z)*10;
myMc.flames=(5-z)*5;
myMc.posy=50*this.j;
myMc.onEnterFrame=oscillate;
}
}
}
this.onEnterFrame=function(){
index=1;
this.clear();
this.lineStyle(2,0xFF0000,100);
this.moveTo(this["rond"+index]._x,this["rond"+index]._y);
for (var n=0;n < k-1;n++){
if (!(index%5)||index==1){
this.moveTo(this["rond"+index]._x,this["rond"+index]._y);
this.beginFill(0xFF6600,100);
}
index++;
this.lineTo(this["rond"+index]._x,this["rond"+index]._y);
}
this.endFill();
}
pom :cowboy:
And there’s also that one: http://www.station4net.com/flashfx/047-25-lines.html
// Dmitry Yamaykin aka DeliMIter
// for 25-lines Contest brings this thing.
// "Locked Space"
// 14 lines total
Mouse.hide();
createEmptyMovieClip("BG", -17000).beginFill(0x00, 100);
for (var i=0; i<4; i++) BG.lineTo(i < 2? Stage.width: 0, (i == 0)or(i == 3)? 0: Stage.height);
onEnterFrame = onMouseMove = function() {
(Clip = createEmptyMovieClip("C" + (++_depth < 1000? _depth: _depth = 0), _depth))._x = _xmouse + random(10) - 12;
Clip._y = _ymouse + random(10) - 2;
Clip.beginFill(random(0x100) << 8 | 0xFF0000, 100);
for (var i=0; i<4; i++) Clip.curveTo((i == 0)or(i == 3)? 0: 10, (i < 2)? 5: -5, (i == 3)? 0: (i == 1)? 10: 5, (i == 0)? 5: (i == 2)? -5: 0);
Clip._dir = random(30) - 15 - 90;
Clip._xscale = Clip._yscale = 150 + random(50);
Clip.onEnterFrame = function() {
this._x += 3 * Math.cos(this._angle = (this._dir += random(7) - 3) * Math.PI/180);
this._y += 3 * Math.sin(this._angle);
if ((this._alpha = (this._xscale = this._yscale *= 0.95) / 4) < 10) this.removeMovieClip();
}
}
HEY, NO OBFUSCATED CODE HERE MAN!!!
LOL, Delimiter is one excellent coder though. I checked out his stuff at the bit forums… jaw dropping :o
Well, this one is pretty easy on the obfuscation…
Yeah, with the exception of the lineTo and curveTo, but that isn’t too hard to understand.
Hey thanks alot. i think i can make something with this
Please show us when you’re done
bit forum…?
The forum at www.bit-101.com