Here's a simple, dopey little script. It draws a wavering circle of light (like that produced by a fire or candle), centered at the location of an FFC (see the picture, though you won't see it waver...). I tried to explain everything in the comments, but it basically draws a filled, translucent circle with a slightly random radius. You can control the radius and the amount of "variance" from that radius, as well as how fast it wavers. You can also set the color of the circle. The circle is drawn on layer 6, so it affects the way Link and enemies look when they're in the light. Since I tied the circle to the center of the FFC, it might be interesting to use this with a moving FFC though I haven't tried it yet.
I was going to use it for some camp-fire mood lighting, but maybe someone else can do something cooler with it....
I didn't spend any time on error handling/range checking, so I don't know what will happen, if for instance, the wobble is greater than the min_radius....
In the screenshot, I used a min_radius of 24 and a wobble of 3 and it looked decent. You'll have to experiment with the color to get the proper look of the transparency.
Code:
// Script : Light_Circle
// Purpose : Renders a circle of "light" on the screen. This
// can be used to simulate light cast by fires,
// lanters, etc. The center of the circle is positioned
// at the _center_ of the FFC to which this
// script is assigned.
// Args :
// * min_radius: the minimum radius, in pixels, of the circle.
// Measured from the CENTER of the FFC.
// * wobble : the maximum number of pixels by which to vary
// the radius. This can be used to simulate the
// wavering light of a campfire or candle.
// * speed : The speed of the wobble. 1 = recompute the wobble
// every frame, 2 = every other fame,
// 3 = every third frame, etc.
// * color : The color used to draw the circle, from the 256 pallete.
// Notes :
// 1. As originally written, the script draws the circle on
// layer 6 so that it affects Link's colors.
//
ffc script Light_Circle{
void run(int min_radius, int wobble, int speed, int color){
int rand_r = min_radius;
int speed_count = 0;
// Draw a translucent circle, filled, to simulate
// the light thrown by a fire or light.
while(true){
if(speed_count >= speed){
rand_r = min_radius + Rand(wobble);
speed_count = 0;
}
Screen->Circle(6, this->X + 8, this->Y + 8, rand_r, color, 1, 0, 0, 0, true, 64);
speed_count++;
Waitframe();
}
} // run
}