color changing

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

color changing

Postby j2graves » Fri Nov 14, 2008 8:18 pm

I just thought I'd try and be helpful for once, so I made a demo on how to make colors change in a loop. I figured this one out for myself and I made it full screen for no reason.
Attachments
color~purple.PNG
screenshot
color.zip
(3.25 KiB) Downloaded 278 times
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby Kalladdolf » Fri Nov 14, 2008 8:26 pm

nice, very handy method for menu backgrounds.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: color changing

Postby j2graves » Sat Nov 15, 2008 3:35 pm

hasn't ANYONE else tried it?!
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby Kalladdolf » Sat Nov 15, 2008 8:40 pm

it is frustrating, isn't it?
new demos get buried by other old demos which are being bumped continuously and you begin to wonder why to even post.
My GE lightening effect got only 2 replies before it died.

Peoples, it doesn't hurt to post a comment, what you think, what you'd suggest, what you like, what you don't like, what you don't understand.
This demo has been downloaded 5 times. Kay, there should be exactly 5 replies. J2graves would be happy and my feelings exactly.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: color changing

Postby pyrometal » Sun Nov 16, 2008 12:20 am

The effect is pretty smooth and I like it! I recall using something like this somewhere before... Anyway, good work, this could be helpful to someone who wants ambient effects in their game.

--pyro
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: color changing

Postby j2graves » Sun Nov 16, 2008 10:15 pm

thank you =D
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby j2graves » Sun Nov 23, 2008 10:50 pm

I posted this trying to be helpful but everyone is ignoring this!
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby pyrometal » Mon Nov 24, 2008 1:09 am

It happens a lot around here you know, which does suck unfortunately...
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: color changing

Postby j2graves » Sat Dec 06, 2008 10:27 pm

that's too bad. by the way, I forgot to celebrate my 1000th post. YAY! there. this is actually my 1010th post
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby jimmynewguy » Sat Feb 07, 2009 4:30 am

hey pretty neat, i just might end up using this in my game.... :D
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: color changing

Postby j2graves » Sun Feb 08, 2009 1:58 am

finally someone noticed! =D
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby DST » Sun Feb 08, 2009 2:08 am

its good, you have the concept right, but let me throw this one at you;

draw actor:
r=rlaser[0];
g=rlaser[1];
b=rlaser[2];

Now for the event, timer, whatever: (where limiter is actor integer, torq is global integer).

Code: Select all
int j;
    switch(limiter){
    case 0:
    rlaser[1]+=torq;
    if(rlaser[1]>=255){
        limiter+=1;}
    break;
    case 1:
    rlaser[0]-=torq;
    if (rlaser[0]<=0){
        limiter+=1;}
    break;
    case 2:
    rlaser[2]+=torq;
    if(rlaser[2]>=255){
        limiter+=1;}
    break;
    case 3:
    rlaser[1]-=torq;
    if (rlaser[1]<=0){
        limiter+=1;}
    break;
    case 4:
    rlaser[0]+=torq;
    if(rlaser[0]>=255){
        limiter+=1;}
    break;
    case 5:
    rlaser[2]-=torq;
        if (rlaser[2]<=0){
        limiter=0;}
    break;
 
 
 
 
    }
for (j=0; j<3; j++){
if(rlaser[j]<0){rlaser[j]=0;}
              }



The loop prevents any of the colors from being less than 0, and the variable 'torq' allows you to control the speed of the fade.

Also, these colors, (by using 255 as a max) always maintain maximum brightness and saturation. No greys or browns allowed. That part is very similiar to yours, just that you used 200.


What we do is step thru the colors, if a color reaches 255, the previous color declines; when the previous color is 0, the next color increases; and when the next color reaches 255, the current one decreases, and so on.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
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: color changing

Postby j2graves » Sun Feb 08, 2009 2:51 am

thanx for that. glad to see there's finally some conversation coming out of this topic.
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby j2graves » Thu Feb 12, 2009 7:42 pm

and it's forgotten again...
No games to my name...
User avatar
j2graves
 
Posts: 1302
Joined: Thu Aug 16, 2007 6:42 pm
Location: on the other side of infinity
Score: 19 Give a positive score

Re: color changing

Postby jimmynewguy » Thu Feb 12, 2009 8:58 pm

not as bad as mine though http://game-editor.com/forum/viewtopic.php?f=6&t=6463 50 downloads 1 reply.....
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Next

Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest