Im stuck xD. Im using Cucumber's day night cycle as an outline for mine in my game. It works well btw
http://forum.thegamecreators.com/?m=forum_view&t=82473&b=6
What Im trying to do is incorporate a Sunrise right now. You know all those purple colors that come up as the sun does. Here's the sunrise code I tried to put together:
Purple is a variable I have set to 20.
if(dbObjectPositionY(2) >=-20 && dbObjectPositionY(2) <=75){
purple++;
if(purple >= 50){
purple = 50;
}
dbColorBackdrop(dbRgb(blue1+purple,128,blue1+purple));
dbColorAmbientLight(dbRgb(blue1+purple,128,blue1+purple));
dbFogColor(dbRgb(blue1+purple,blue1/2,blue1+purple));
}else if(dbObjectPositionY(2) >=76 && dbObjectPositionY(2) <=255){
purple--;
if(purple <= 0){
purple = 0;
}
dbColorBackdrop(dbRgb(purple,blue1,purple));
dbColorAmbientLight(dbRgb(blue1,blue1,blue1));
dbFogColor(dbRgb(blue1/2,blue1/2,blue1/2));
}else{
dbSync();
if (blue1 >= 255)
{
bInc = -.1;
}
if (blue1 <= 20 )
{
bInc = .1;
}
blue1 = blue1 + bInc;
//dbPrint(dbStr(dbObjectPositionY(2)));
dbColorBackdrop(dbRgb(0,0,blue1));
dbColorAmbientLight(dbRgb(blue1,blue1,blue1));
dbSetAmbientLight(60);
dbSetObjectLight(1, 1);
dbFogColor(dbRgb(blue1/2,blue1/2,blue1/2));
}
What I want to happen is the backdrop color change from the blue1 variable to more of a purpleish color. Then when it reaches the other height, I want that purple to fade away. I know the second if statement is totally out of wack, because Im trying to first get the purple to fade in first. Then Ill worry about it fading out back to blue.
If anyone could help me on this, Id really appreciate it. (Im also sick today, so that doesnt help my programming lol)