Light All Clones

You must understand the Game Editor concepts, before post here.

Light All Clones

Postby ZeldaFan » Mon Jul 06, 2015 1:58 am

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);
ZeldaFan
 
Posts: 31
Joined: Sat Jul 04, 2015 5:38 pm
Score: 12 Give a positive score

Re: Light All Clones

Postby bat78 » Thu Jul 30, 2015 12:17 pm

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).
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest

cron