' GRADIENT - FEB 08 2007
; this was from zawran on BlitzMax a
; And I have convert to freebasic with Bob and gradients =)
Const ScreenX=106
Const ScreenY=106
Const ESCAPE =1
' PLAY AROUND WITH THESE ON SIZE AND DEGREE( 0 TO 360 )
Const SIZE =140
Const DEGREE=100
'' set screen mode
SCREEN 18
'' allocate and draw to an image buffer
DIM image_buffer AS ANY PTR
image_buffer = ImageCreate( 256, 256, RGBA( 64, 160, 0, 255 ) )
'CIRCLE ( 32, 32 ), 28, RGBA( 255, 0, 0, 128 ),,,,F
For X=1 To ScreenX
For Y=1 To ScreenY
' Play around with X,Y by swap around for different COLORS!
Color (X,Y)
' Draw the Line
Line image_buffer,(X,Y)-(X,Y)
Next X
Next Y
' bob effect !
Dim bobx(DEGREE)
Dim boby(DEGREE)
For i = 0 To 63
bobx( i ) = i * SIZE Mod DEGREE
boby( i ) = i * SIZE Mod DEGREE
Next
bobXadd = 1 ' this is the values we add To move the bobs
bobYadd = 2 ' change these For different patterns
While INKEY$ = ""
Cls
For i = 0 To 63
' blit image buffer to screen
PUT( 300 + Sin( bobx(i) ) * 300, 300 + Sin( boby(i) ) * 224 ), image_buffer, PSET
'PUT( 180, 140 ), image_buffer, ALPHA
Next i
For i = 0 To 63
bobx(i) = bobx(i) + bobXadd Mod DEGREE
boby(i) = boby(i) + bobYadd Mod DEGREE
Next i
Wend
I got a problem with this and could anyone sort out for me please
cheers