Originally Posted by
ZoriaRPG
EndAngle should be higher. Try running your code with the debugging function that I posted.
I feel almost like Arc needs a conversion function to work easily with other stuff, since it is so non-intuitive.
As I posted on Discord, I was confused because the correct (and incorrect) results happened both when startangle was larger and when it was smaller.
Using the function you posted, I changed the code like so...
Code:
//Section 120. Eye Sentry
ffc script Eye_Sentry{
void run(int item_id, int perm, bool left){
bool triggered = false;
float angle;
int sfxTimer;
if(Screen->D[perm]==1)
triggered= true;
while(!Link->Item[item_id])
Waitframe();
//Screen->D[perm]=1;
this->Data++;
while(!triggered){
if(left){
angle = Angle(this->X+24, this->Y+8,Link->X+8,Link->Y);
//angle*=-1;
Arc(3, this->X+24, this->Y+8, 256, angle-10,angle+10, 1, 1, 0, 0, 0, true, true, OP_TRANS,true);
}
else{
angle = Angle(this->X+8, this->Y+8,Link->X+8,Link->Y);
//angle*=-1;
Arc(3, this->X+8, this->Y+8, 256, angle-10,angle+10, 1, 1, 0, 0, 0, true, true, OP_TRANS,true);
}
//Create sound every sixty seconds.
if ( sfxTimer == 0 ) Game->PlaySound(SFX_X_RAY);
sfxTimer = (sfxTimer+1)% 60;
Waitframe();
}
this->Data=GH_INVISIBLE_COMBO;
}
}
I didn't get the screen-covering effect, just an arc that was on the opposite side of the screen from what I wanted.
I'm not sure about the best way to rotate it to where it should be.
I'd previously used angle *=-1 but that didn't really work. Nor did using WrapDegrees on the outcome of that.
Any suggestions? My alternative is to use a versiion of Screen->Triangle Moosh provided which I've already gotten to replicate the effect I want.
(Hence my interest here is mostly to find the cause of this.)