[bb] Lines around ball by Bremer [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:41

Previous topic - Next topic

BlitzBot

Title : Lines around ball
Author : Bremer
Posted : 1+ years ago

Description : Just some fun with lines and types

Code :
Code (blitzbasic) Select
; Created on July 10th 2003 by Zawran
; feel free to use and change

Graphics 800,600,32,2

SeedRnd MilliSecs()

Type lines
Field a#,c,z#,d
End Type

SetBuffer BackBuffer()

While Not KeyHit(1)

If linesnew + 70 <= MilliSecs() Then
linesnew = MilliSecs()
newLines()
End If

For l.lines = Each lines
Color 0,0,lc
Line 400+Sin(la)*40,300+Cos(la)*40,400+Sin(la)*lz,300+Cos(la)*lz
Next

If linesupd + 13 <= MilliSecs() Then
linesupd = MilliSecs()
For l.lines = Each lines
If ld = 1 Then la = la + Rnd(1,2)
If ld = 2 Then la = la - Rnd(1,2)
If la < 0 Then la = la + 360
If la > 359 Then la = la + 360
lz = lz - 1.8
lc = lc - 2
If lc < 0 Then Delete l
Next
End If

Color 255,255,255
If Timer + 1000 <= MilliSecs() Timer = MilliSecs() : FPS_Real = FPS_Temp : FPS_Temp = 0
FPS_Temp = FPS_Temp + 1 : Text 0,580,"FPS: " + FPS_Real

Flip
Cls
Wend
Delete Each lines
End

Function newLines()
ang = Rnd(359)
For a=0 To 29
l.lines = New lines
la = ang+Rnd(-5,5)
lc = Rnd(150,255)
lz = Rnd(200,256)
ld = Rnd(1,2)
Next
End Function


Comments : none...