Page 1 of 1

Light All Clones

PostPosted: Mon Jul 06, 2015 1:58 am
by ZeldaFan
I'm using this code any canvas


http://www.youtube.com/watch?v=zjz-RzysjdY


global code:
Code: Select all
void drawCircle(double xpos, double ypos, double r)
{
    int xp, yp;
    for(yp=floor(ypos)-ceil(r);yp<ceil(ypos)+ceil(r);yp++)
    {
        for(xp=floor(xpos)-ceil(r);xp<ceil(xpos)+ceil(r);xp++)
        {
            if(sqrt(pow(max(xpos, xp)-min(xpos, xp), 2)+pow(max(ypos, yp)-min(ypos, yp), 2))<=r)  // This says put a pixel if it is within the circle, radius of r
            {
                         putpixel(xp, yp);  // Puts the actual pixels in
            }
        }
    }
}
void SetLight(int X, int Y, double R)
{
    draw_from("light", X, Y, R/light.width);
}



effect ative:
Code: Select all
SetLight(player.xscreen, player.yscreen, 70);

SetLight(fire.xscreen, fire.yscreen, 50);

Re: Light All Clones

PostPosted: Thu Jul 30, 2015 12:17 pm
by bat78
Awfully unclear what're you asking. (It generally doesn't seem like a question on a first place).
I'm sorry. :)

If this is discussing the script, I have nothing against it, as it works.
(Besides, a review wasn't requested).