PDA

View Full Version : Patra-type rotation script.



Gleeok
10-08-2007, 09:00 PM
The idea is to use 4 and/or 8 rotating ffc's at a time that rotate clockwise(or counter-clockwise) around this->X, and this->Y, which is either centered on an enemy, or keeping an enemy centered on <this_ffc>.

Where the rotating ffc's are called by// e = Screen->LoadFFC; e->data = comboX;

All the actual scripting is basically done minus the rotation part, I admit that I am not good at this kind of math.

What I was doing was:



flame1->X = this_ffc->X + (16 * Sin(i*s));
flame1->Y = this_ffc->Y + (16 * Cos(i*s));
i++;

and then just changing + and - around for each orbiting ffc...which didn't work too well.


So I guess I need to evenly offset each rotating ffc...not sure, but again there will either be 8 or 4 ffc's that rotate at ceartain points during the script.

C-Dawg
10-08-2007, 10:23 PM
Simple orbit script is available in Zodiac. You can modify it to let you input a different start value for "wobble" for each orbit. Just take 360 degrees and divide it into six or eight or however many equal chunks of degrees, that'll be your start for each one. For instance, to have four orbiting ffcs each equadistant from each other:
wobble1 = 0;
wobble2 = 90;
wobble3 = 180;
wobble4 = 270;

(Note that on a circle, 0 = 360)

You can put them together or run orbit on each individual ffc.

Gleeok
10-08-2007, 10:34 PM
Ahh shit, how did I miss that?...so that's why when you increment wobble++. It just cycles through degrees of 360. Haha, thanks. I'll give it another go.

Gleeok
10-10-2007, 02:42 AM
OK, now i'm massively confused...I really can't see why this isn't working...

setup variables:


if(radius == 0){ radius = 32; }
int wobble = 0;
int wobble2 = 90;
int wobble3 = 180;
int wobble4 = 270;
int wobble5 = 45;
int wobble6 = 135;
int wobble7 = 225;
int wobble8 = 315;

ffc flame1 = Screen->LoadFFC(10);
ffc flame2 = Screen->LoadFFC(11);
ffc flame3 = Screen->LoadFFC(12);
ffc flame4 = Screen->LoadFFC(13);
ffc flame5 = Screen->LoadFFC(14);
ffc flame6 = Screen->LoadFFC(15);
ffc flame7 = Screen->LoadFFC(16);
ffc flame8 = Screen->LoadFFC(17);
flame1->Data = flamecom;
flame2->Data = flamecom;
flame3->Data = flamecom;
flame4->Data = flamecom;
flame5->Data = flamecom;
flame6->Data = flamecom;
flame7->Data = flamecom;
flame8->Data = flamecom;



and rotation part:


flame1->X = this_ffc->X + (radius * Sin(wobble*speed));
flame1->Y = this_ffc->Y + (radius * Cos(wobble*speed));

flame2->X = this_ffc->X + (radius * Sin(wobble2*speed));
flame2->Y = this_ffc->Y + (radius * Cos(wobble2*speed));

flame3->X = this_ffc->X + (radius * Sin(wobble3*speed));
flame3->Y = this_ffc->Y + (radius * Cos(wobble3*speed));

flame4->X = this_ffc->X + (radius * Sin(wobble4*speed));
flame4->Y = this_ffc->Y + (radius * Cos(wobble4*speed));

flame5->X = this_ffc->X + (radius * Sin(wobble5*speed));
flame5->Y = this_ffc->Y + (radius * Cos(wobble5*speed));

flame6->X = this_ffc->X + (radius * Sin(wobble6*speed));
flame6->Y = this_ffc->Y + (radius * Cos(wobble6*speed));

flame7->X = this_ffc->X + (radius * Sin(wobble7*speed));
flame7->Y = this_ffc->Y + (radius * Cos(wobble7*speed));

flame8->X = this_ffc->X + (radius * Sin(wobble8*speed));
flame8->Y = this_ffc->Y + (radius * Cos(wobble8*speed)); }


There should be 8 ffc's of equal distance, instead there is only 4. Apparently they're in groups of two stacked on top of each other..:confused:

C-Dawg
10-10-2007, 07:25 PM
Huh. Yea, off the top of my head, I don't know why that isn't working. I'll take a look.