PDA

View Full Version : Custom Component (long ass post)(actionscript gods wanted)



Jaded
April 4th, 2006, 01:06 AM
Okay i need help from a hardcore actionscriptor who is

farmiliar with making custom components.

I am creating a component

that when placed on the field is used for generating the physics of a used

shell being shot out the side of the weapon. I no its nothing to special it

took me about an 2 hours but im tired of animating those god damn shells lol.



HHeres the swf of what i have so

far.
[url]http://i49.photobucket.com/albums/f271/sk8king989/shellComp.swf[

/url]

As you can see it jitters a whole lot at the end.
This is the

script. (btw things in the script in brackets with a * i added to let u know

what the param is)
//defines class
#initclip
function Bulletclass ()

{
this.update();
this.xmov = this.xspeed;
this.ymov =

this.yspeed;
this.rota = random(120)-

60;
}
Bulletclass.prototype = new

MovieClip();
Bulletclass.prototype.update = function(){
//colision

with ground
if(this._y >= this.fheight(*ground param)){


if(bounce = true){
this._y = this.fheight;


this.ymov = -(this.ymov*this.bouncer(8bounce param));


this.rota(*roation) = random(120) - 60;
}else{


this.ymov(*yspeed) = 0;


this.terV(*terminal velocity) = 0;
this._y =

this.fheight;
this.rota = 0;
}


}
if(this.ymov < this.terV){
this.ymov +=

this.grav(*gravity);
}
if(this.xmov > 1 || this.xmov <

-1){
this.xmov *= this.xdecay(* x friction);


}else{
this.xmov = 0;
}
this._x +=

this.xmov;
this._y += this.ymov;
this._rotation +=

this.rota
}
// Connect the class with the linkage ID for this movie

clip
Object.registerClass("Bshells_mc", Bulletclass);
#endinitclip


this.onEnterFrame = function() {
this.update();
}
I

need to find a way to make it that when it has a small enough bounce that it

stops bouncing and rotating. If you do not understand what i ask please tell

me why and i will try to explain it to you. Ive tried to fix this with many

methods but they didnt work
PS if you dont understand by this script in

the post if i knew how i could send you the fla. PLS HELP!

fedora
April 4th, 2006, 01:45 AM
err

you dont have to use actionscript...

Jaded
April 4th, 2006, 02:16 AM
?? please inform me of what you speak of lol