| Ad_Infinitum |
| Administrator |

 |
 |
| Data inscrierii: 23/Iun/2007 |
| Mesaje: 212 |
|
|
|
 |
 |
 |
|
REM ==========================
REM DBC Challenge: Screensaver
REM Author: Phaelax
REM ==========================
RANDOMIZE TIMER()
REM VARIABLES
depth#=400
screenwidth#=800
screenheight#=600
`color as dword
color = RGB(205,255,255)
newColorDelayAmount = 3000
newColorDelay = 0
total2=40
DIM x2#(total2)
DIM y2#(total2)
DIM a2#(total2)
x2#=RND(screenwidth#)
y2#=RND(screenheight#)
f3=RND(1)
f4=RND(1)
total3=total2
DIM x3#(total3)
DIM y3#(total3)
DIM a3#(total3)
x3#=RND(screenwidth#)
y3#=RND(screenheight#)
f5=RND(1)
f6=RND(1)
REM VARIABLES CALCULATIONS
width#=(depth#/10)*16
height#=(depth#/10)*12
even#=screenwidth#/1.6
prop#=depth#/even#
REM SETUP
SET DISPLAY MODE screenwidth#,screenheight#,32
POSITION CAMERA width#/2,height#/-2,0
SYNC ON
AUTOCAM OFF
HIDE MOUSE
BACKDROP ON
`color backdrop 0
REM OBJECTS
FOR t=1 TO total2
MAKE OBJECT PLAIN t+100,100,20
COLOR OBJECT t+100,RGB(0,0,(total-t)*6)
GHOST OBJECT ON t+100
NEXT t
FOR t=1 TO total3
MAKE OBJECT PLAIN t+200,100,20
COLOR OBJECT t+200,RGB(0,(total-t)*6,0)
GHOST OBJECT ON t+200
NEXT t
SYNC RATE 40
REPEAT
a2#(1)=WRAPVALUE(a2#(1)-4)
a3#(1)=WRAPVALUE(a3#(1)+6)
IF newColorDelay + newColorDelayAmount < TIMER()
tr = RND(255)
tg = RND(255)
tb = RND(255)
newColorDelay = TIMER()
ENDIF
color = getFadedValue(cr,cg,cb,tr,tg,tb)
INK color,0
cr = RGBR(color)
cg = RGBG(color)
cb = RGBB(color)
GOSUB get_new_positions_blue
GOSUB get_new_positions_green
FOR t=1 TO total2
POSITION OBJECT t+100,x2#(t),y2#(t),depth#
ttr=cr-(t-1)*6
ttg=cg-(t-1)*6
ttb=cb-(t-1)*6
IF ttr<0 THEN ttr=0
IF ttg<0 THEN ttg=0
IF ttb<0 THEN ttb=0
COLOR OBJECT t+100, RGB(ttr,ttg,ttb)
ZROTATE OBJECT t+100, a2#(t)
POSITION OBJECT t+200,x3#(t),y3#(t),depth#
COLOR OBJECT t+200, RGB(ttr,ttg,ttb)
ZROTATE OBJECT t+200, a3#(t)
NEXT t
SYNC
UNTIL MOUSEMOVEX() <> 0 OR MOUSEMOVEY() <> 0
END
get_new_positions_blue:
FOR t=total2 TO 2 STEP -1
x2#(t)=x2#(t-1)
NEXT t
FOR t=total2 TO 2 STEP -1
y2#(t)=y2#(t-1)
NEXT t
FOR t=total2 TO 2 STEP -1
a2#(t)=a2#(t-1)
NEXT t
IF f3=1 THEN INC x2#,9
IF f3=0 THEN DEC x2#,9
IF x2#>800 THEN f3=0
IF x2#<0 THEN f3=1
IF f4=1 THEN INC y2#,9
IF f4=0 THEN DEC y2#,9
IF y2#>600 THEN f4=0
IF y2#<0 THEN f4=1
x2#(1)=x2#*prop#
y2#(1)=y2#*prop#*-1
RETURN
get_new_positions_green:
FOR t=total3 TO 2 STEP -1
x3#(t)=x3#(t-1)
NEXT t
FOR t=total3 TO 2 STEP -1
y3#(t)=y3#(t-1)
NEXT t
FOR t=total3 TO 2 STEP -1
a3#(t)=a3#(t-1)
NEXT t
IF f5=1 THEN INC x3#,6
IF f5=0 THEN DEC x3#,6
IF x3#>800 THEN f5=0
IF x3#<0 THEN f5=1
IF f6=1 THEN INC y3#,6
IF f6=0 THEN DEC y3#,6
IF y3#>600 THEN f6=0
IF y3#<0 THEN f6=1
x3#(1)=x3#*prop#
y3#(1)=y3#*prop#*-1
RETURN
FUNCTION getFadedValue(currentR,currentG,currentB,targetR, targetG, targetB) AS DWORD
IF currentR > targetR THEN DEC currentR,1
IF currentR < targetR THEN INC currentR,1
IF currentG > targetG THEN DEC currentG,1
IF currentG < targetG THEN INC currentG,1
IF currentB > targetB THEN DEC currentB,1
IF currentB < targetB THEN INC currentB,1
color = RGB(currentR, currentB, currentB)
ENDFUNCTION color
-------------------------------------ScreenShot-------------------------------
 |
|