random light effect.

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

random light effect.

Postby Sgt. Sparky » Fri May 25, 2007 12:50 am

here is a random light effect,
just put this on any event or on the create actor event of your canvas actor.
:D
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(possize, possize, 0, 0, Size);
    putpixel(150, 150);
}

you can also play around with the stuff to make it different colours.
the one I posted was for a yellow light.
WHITE:
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(possize, possize, possize, 0, Size);
    putpixel(150, 150);
}

RED:
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(possize, 0, 0, 0, Size);
    putpixel(150, 150);
}

GREEN:
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(, possize, 0, 0, Size);
    putpixel(150, 150);
}

BLUE:
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(0, 0, possize, 0, Size);
    putpixel(150, 150);
}

PURPLE:
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(possize, 0, possize, 0, Size);
    putpixel(150, 150);
}

ect. :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

i don't get it

Postby DST » Wed May 30, 2007 5:24 am

ummm....that's the exact same code for each color....wtf?
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: i don't get it

Postby Sgt. Sparky » Wed May 30, 2007 12:21 pm

DST wrote:ummm....that's the exact same code for each color....wtf?

eh?
look at the code,
when it sets the pen colour it uses different numbers.
that is all.
(it is almost the Same code, there is a number difference. :P )
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Thu May 31, 2007 12:45 am

I wonder what would
Code: Select all
int Size, possize;
possize = 0;
Size = 255;
for(Size = 255; Size > 0; Size--, possize++)
{
    setpen(cos(possize), possize/2, possize, 0, Size);
    putpixel(150, 150);
}

would od
why not discover it!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest