Hello , after i learned a little bit from other coders here in the Forum
i programmed this example here :
A nice Starscroller from left to right with some line Drawings in it !
Have Fun !

Code: Select all
#desw=400
#desh=150
anzahl.l = 200
array:
Structure Star
x.f
y.f
v.f
col.f
EndStructure
Dim stern.Star(anzahl)
For array = 0 To anzahl
Stern(array)\x = Random(#desw)
Stern(array)\y = Random(#desh)
Stern(array)\v = 0.5 + Random(45)/30
Stern(array)\col = 100 + Random(900)
Next array
Procedure Drawchar(zeichen.s,x.f,y.f,col.b,gr.b)
Select zeichen
Case "c"
Line (x,y,gr,0,col)
Line (x,y,0,gr,col)
Line (x,y+gr,gr,0)
Case "h"
Line (x,y,0,gr+1,col)
Line (x,y+gr/2,gr,0,col)
Line (x+gr,y,0,gr+1,col)
Case "o"
Line (x,y,gr,0,col)
Line (x,y,0,gr,col)
Line (x,y+gr,gr,0)
Line (x+gr,y,0,gr+1,col)
Case "s"
Line (x,y,gr,0,col)
Line (x,y,0,gr/2,col)
Line (x,y+gr/2,gr,0,col)
Line (x,y+gr,gr,0,col)
Line (x+gr,y+gr/2,0,gr/2+1,col)
EndSelect
EndProcedure
;Gosub array
InitSprite()
OpenWindow(0,150,150,#desw,#desh,#PB_Window_SystemMenu | #PB_Window_MinimizeGadget,"=-window-=") ; Open the window game
OpenWindowedScreen(WindowID(),0,0,#desw,#desh,0,1,1)
posx.l=1
a.l=1
b.l=1
g.b=18
posy.b=#desh/2-10
Repeat
ClearScreen(0,0,0)
StartDrawing(ScreenOutput())
Drawchar("c",20+posx,posy,255,g)
Drawchar("h",40+posx,posy,255,g)
Drawchar("o",60+posx,posy,255,g)
Drawchar("s",80+posx,posy,255,g)
Drawchar("c",100+posx,posy,255,g)
posx=posx+a
posy=posy+b
If posx = #desw-120
a=-1
EndIf
If posx = 1
a=1
EndIf
If posy = #desh-40
b=-1
EndIf
If posy = 10
b=1
EndIf
For many = 0 To anzahl
If Stern(many)\x > #desw
Stern(many)\x = Random(#desw)
Stern(many)\y = Random(#desh)
Stern(many)\v = 0.5 + Random(45)/10
Stern(many)\col = 100 + Random(900)
Else
Stern(many)\x = Stern(many)\x + Stern(many)\v
x=Stern(many)\x
y=Stern(many)\y
col = 255-(Stern(many)\col *(255./1000.))
Plot (x,y,RGB ( col,col,col ) )
EndIf
Next many
StopDrawing()
FlipBuffers()
EventID.l = WindowEvent()
Until EventID = #PB_EventCloseWindow