basically what i want to do is have it like a static movie clip and the next movie clip pushes the first one in the path of the spiral…like htey were solid objects that couldnt overlap
[edit] This is my code in its entirety atm(as commented as i could make it)
stop()
var myCount = 1
/*
function setBrightness(col:Color, brightness:Number):Void {
var anum:Number = 100-brightness;
var bnum:Number = 255/100*brightness;
col.setTransform({re:anum, ga:anum, ba:anum, rb:bnum, gb:bnum, bb:bnum, aa:100, ab:0});
}*/
var scaleMax:Number =2500; //Max Scale
var fadeOut:Number = 0.93; //Fadeout(think i made it useless by removing setBrightness...but meh
var frequency:Number = 10; // frequency of ball release(somewhat randomized
var colMin:Number = 5; // ??????
var colMax:Number = 10; // ??????
var colVariance:Number = colMax-colMin; //???????
var hRad:Number = 400.25 //Horizontal radius
var vRad = 400.25 //Vert Radius
var vRadInc:Number = -0.8 //these control how quickly the objects spiral in/ out
var hRadInc:Number = -0.8 // a neg number will spiral in a pos num will spiral out
function lrSpeed(Void):Number { //
return 1+1.98953*1;
}
function scaleUpSpeed(Void):Number {
return 1;
}
function nooCol(Void):Number {
return colMin+0.1573*colVariance;
}
var depth:Number = 0;
onEnterFrame = function () {
myCount++
if (depth == 0 || _root["ball"+depth]._x < 670) {
depth++;
var MC_toAttach:String = AssignMovie()
var noo:MovieClip = _root.attachMovie(MC_toAttach, "ball"+depth, depth);
var col:Color = new Color(noo);
//setBrightness(col, nooCol());
noo._x = -150;
noo._y = -150;
noo._xscale = noo._yscale=100;
noo.scaleSpeed = scaleUpSpeed();
noo.lrSpeed = lrSpeed();
noo.hRad = hRad;
noo.vRad = vRad;
noo.hRadInc = hRadInc;
noo.vRadInc = vRadInc;
noo.lr = 0;
noo.onEnterFrame = _root.Spiral;
}
};
function Spiral() { //this is the function thats in each clips on enter
//It Moves the clip in a spiral
this.lr += this.lrSpeed // LR has something to do with speed
this.hRad += this.hRadInc;
this.vRad += this.vRadInc;
//this code just figures out what ball were moving not used atm
stringtoparse = String(this)
parsedstring = stringtoparse.split("ball")
thisindex = Number(parsedstring[1]);
// this places the object
this._y = 300+this.hRad*Math.sin(this.lr*Math.PI/180);
this._x = 300+this.vRad*Math.cos(this.lr*Math.PI/180);
}
function AssignMovie(){
return "Catseye_grn"
}
just seeing if anyone in the monday morning crowd has any ideas on how i can alter my code to gradually speed up the objects movement as it gets closer to the center so it doesnt bunch up like that
function Spiral() { //this is the function thats in each clips on enter
//It Moves the clip in a spiral
this.lr += this.lrSpeed // LR has something to do with speed
this.hRad += this.hRadInc;
this.vRad += this.vRadInc;
this.hRadInc*=1.001
this.vRadInc*=1.001
//this code just figures out what ball were moving not used atm
stringtoparse = String(this)
parsedstring = stringtoparse.split("ball")
thisindex = Number(parsedstring[1]);
// this places the object
this._y = 300+this.hRad*Math.sin(this.lr*Math.PI/180);
this._x = 300+this.vRad*Math.cos(this.lr*Math.PI/180);
if(Math.abs(this._x-300)<1 && Math.abs(this._y-300)<1){
this.removeMovieClip()
}
}
thanks for the sugestion…unfortunatly it didnt fix it
heres my WIP so far (Spirals1)
spirals2 has your amendment added
(the only thing i changed was
this.hRadInc*=1.001
this.vRadInc*=1.001
)
Spirals1.swf = my current one(I want the spiral like this but i dont want the balls to bunch up at center)
spirals2.swf = my current code with suggested amendmant
[edit] it wont let me post other attach for some reason…but it doesnt stop the overlap just changes the shap of the spiral basically
I messed with that a bit before i posted…It wasnt helping but ill try some other stuff once i get home from work in 8 hours
bassically what would be ideal would be if everytime a MC was created all the previous MC’s would be pushed forward along the trajectory(like if the circles were solid objects)
(like
Create 1_mc at 30,35
create 2_mc @ 30,35 (push 1_mc to 60,35)
create 3_mc @ 30,35(push 1_mc to 90,35 ; push 2_mc to 60,35)
(each cycle is MC._x +=30 )
…
would move them in a straight line
Yeah exactly like hitTest each other…but it gets all choppy if i add
[AS]
if(!this.hitTest(_root[“ball” +(thisindex - 1)]){ // check to make sure its not coliding with the ball in fron before moving
this._y = 300+this.hRadMath.sin(this.lrMath.PI/180);
this._x = 300+this.vRadMath.cos(this.lrMath.PI/180);
}
[/AS]
and the motion just looks like crap and gets all jerky when they start hitTesting
I think its cause the Object I want to hittest is a circle(but hittests always register as squares…)
Im just getting frusterated with getting my balls to act the way i want(heh that sounds bad)