Posted: 7th Dec 2003 0:37
Made this mostly because I was bored...

Just a quick little demonstration on how you can use fog and integers to demonstrate day to night and sunrise and sunset. Might be good any RPGs that wanna have a Day + Night system,,or an FPS,,,or whatever

Use however you want

+ Code Snippet
Remstart
-----------------------------------------------
|*********************************************|
|*********RPGamers Night - Day Demo***********|
|****-------------------------------------****|
|*********====== Beta Version 1======*********|
|*********************************************|
|Legal Disclaimer: Use this on your own free  |
|will! I don't care! I made it in my free time|
|so knock yourself out!                       |
|---------------------------------------------|
|oFeatures List                               |
|--------------                               |
|-Global Time System Using Integers           |
|-Total System takes about 10 Minutes         |
|-Realtime Fog Changing                       |
|                                             |
|Contact me at Johnrocs@aol.com or visit The  |
|Game Creators forums and post there. You can |
|also find me at the Eternal Destiny forums   |
|located at.......                            |
|http://www.eternaldestinyonline.com/forums   |
|                                             |
|Cheers!                                      |
|                                             |
|RPGamer                                      |
-----------------------------------------------
remend

`3D!!!
backdrop on

`Variables
global red#
global green#
global blue#
global waitup#

`We Love Sync
sync on
sync rate 60

`Declare the Variables
red#=50
green#=50
blue#=50

`Control the Fog
fog on
fog distance 500

`Create our Matrix to Test Fog On
make matrix 1,1000,1000,10,10
set matrix priority 1,1

`Position Our Camera
position camera 0,200,0
point camera 500,40,500

`The Wait Timer
waitup#=5

`Yes,,,,we still do love SYNC!
sync

`The Timer
time=1

`Captain! Intialize the Main Loop!
do

`Kinda Slower Counting (Inc is a bit faster if you wanna use it)
time=(time+1)

`Display our Variables and stuff
set cursor 0,0:print screen fps()
set cursor 0,15:print "Time:";time

`A little Time Warp :)
if inkey$()="s" then time=20500
if inkey$()="n" then time=41500

`---------------------------------------------------
`~x~x~x~x~x~x~x~x~x~x~x~SUNRISE~x~x~x~x~x~x~x~x~x~x~
`---------------------------------------------------
if time>0 and time< 1050

fog color rgb(red#,green#,blue#)

day#=0
night#=0
sunset#=0
sunrise#=1

dec waitup#,1

if waitup#<0
if red#<210 then inc red#,1
if green#<170 then inc green#,1
if blue#<70 then inc blue#,1

if red#>209 then reddone#=1
if green#>169 then greendone#=1
if blue#>69 then bluedone#=1

if reddone#=1
   if greendone#=1
      if bluedone#=1
if red#<220 then inc red#, 1
if green#<220 then inc green#, 5
if blue#<220 then inc blue#,10
      endif
   endif
endif


if red#=210 then red#=210
if green#=170 then green#=170
if blue#=70 then blue#=70

waitup#=5
reddone#=0
greendone#=0
bluedone#=0

endif

endif

`---------------------------------------------------
`~x~x~x~x~x~x~x~x~x~x~x~DAYTIME~x~x~x~x~x~x~x~x~x~x~
`---------------------------------------------------
if time>1050 and time< 21000
sunrise#=0
night#=0
sunset#=0
day#=1
endif

`--------------------------------------------------
`~x~x~x~x~x~x~x~x~x~x~x~SUNSET~x~x~x~x~x~x~x~x~x~x~
`--------------------------------------------------
if time>21000 and time< 22050

sunrise#=0
night#=0
sunset#=1
day#=0

fog color rgb(red#,green#,blue#)

dec waitup#,1

if reddone#=0
if red#<221 then dec red#, 1
endif

if greendone#=0
if green#<221 then dec green#, 5
endif

if bluedone#=0
if blue#<221 then dec blue#,10
endif


if red#=210 then reddone#=1
if green#=170 then greendone#=1
if blue#=70 then bluedone#=1

if reddone#=1 and greendone#=1 and bluedone#=1
if waitup#<0


if red#>50 then dec red#,1
if green#>50 then dec green#,1
if blue#>50 then dec blue#,1

if red#=50 then red#=50
if green#=50 then green#=50
if blue#=50 then blue#=50

waitup#=5

endif
endif
endif

`-------------------------------------------------
`~x~x~x~x~x~x~x~x~x~x~x~NIGHT~x~x~x~x~x~x~x~x~x~x~
`-------------------------------------------------
if time>22050 and time< 42000
sunrise#=0
day#=0
sunset#=0
night#=1
endif

`Bring Us Back to the Mornin'!
if time>42000 then time=0

`Refresh the Screen and Finish the Loop
sync
loop


Forgive my crappy, careless, unefficient coding. I was just a little bored

RPGamer
Posted: 7th Dec 2003 23:08
lol, captain! initialize the main loop!
Posted: 7th Dec 2003 23:12
Aye Aye!! Wait..I already did that
Posted: 8th Dec 2003 21:21
it ummm, flickers like a rainbow.... then calms.

Very nice for being bored.
Posted: 9th Dec 2003 1:27
When does it flicker for you?