Ok I don't really know why I started this, it just began to get larger and larger and I need to sleep now.
It's pretty basic but does the job. The routine could be adapted so that instead of pasting a black sprite, you could copy the area from a sprite and paste to the screen.
Probably a way easier way to do this :
InitSprite()
InitKeyboard()
#ScreenWidth = 1024
#ScreenHeight = 768
#ScreenBits = 32
#MiddleX = #ScreenWidth / 2
#MiddleY = #ScreenHeight / 2
#Radius = 600
Define grad.f = 0
Structure Vector
x.f
y.f
EndStructure
Global pix.f=2*#PI/360
Macro Distance(p1, p2)
Sqr((p1\x - p2\x) * (p1\x - p2\x) + (p1\y - p2\y) * (p1\y - p2\y))
EndMacro
Declare Norm(*V.Vector)
Define.Vector Direction, Sprite, Destination
Destination\x = 0
Destination\y= 0
Sprite\x = 0
Sprite\y = 0
Procedure Norm(*V.Vector)
Define.f Norm
Norm.f = Sqr(*V\x * *V\x + *V\y * *V\y)
If Norm
*V\x / Norm
*V\y / Norm
EndIf
EndProcedure
Procedure UpdateSpr()
Protected Angle.f, dist, speed.f = 10
Shared Direction,Destination,Sprite
Direction\x = (Destination\x - Sprite\x) ; -1
Direction\y = (Destination\y - Sprite\y)
Norm(@Direction)
dist = DISTANCE(Destination, Sprite)
If dist < speed
Sprite\x + Direction\x * dist
Sprite\y + Direction\y * dist
Else
Sprite\x + Direction\x * speed
Sprite\y + Direction\y * speed
EndIf
EndProcedure
Procedure BuildImage(Sprite,Image,mode)
Protected SpriteID=SpriteID(Sprite)
w=SpriteWidth(Sprite)
h=SpriteHeight(Sprite)
CreateImage(Image,w,h)
StartDrawing(ImageOutput(Image))
*buf = DrawingBuffer()
If DrawingBufferPixelFormat() = #PB_PixelFormat_32Bits_BGR
GetObject_(ImageID, SizeOf(BITMAP), bmp.BITMAP)
If bmp\bmBitsPixel = 32
CopyMemory(bmp\bmBits, *buf, w*h*SizeOf(RGBQUAD))
EndIf
EndIf
StopDrawing()
EndProcedure
Procedure makenewlogo()
Static lastpush
Shared logo, spr1
If lastpush > 0 And ElapsedMilliseconds() - lastpush < 310 : ProcedureReturn : EndIf
patternpool.s = "A0 6C FC 21 C8 B2 F5 EA C2 C4 60 77 6B 22 AE"
pattern.s = Mid(patternpool, FindString(patternpool, " ", Random(Len(patternpool)))+1, 2)
LoadFont(5, "Trebuchet MS" ,57, #PB_Font_Bold)
logo=CreateSprite(#PB_Any, #ScreenWidth,#ScreenHeight, #PB_Sprite_AlphaBlending)
spr1=CreateSprite(#PB_Any,20,20)
StartDrawing(SpriteOutput(spr1)) : Box(0,0,20,20,#Black) : StopDrawing()
StartDrawing(SpriteOutput(logo))
DrawingFont(FontID(5))
DrawText(80, 30, "SKID//ROW NEVER DIES!" , RGB(Random(75)+190, Random(255), Random(75)+190))
DrawText(80, 130, "ELUSIVE DREAMS - USHQ" , RGB(Random(75)+190, Random(255), Random(75)+190))
DrawText(80, 230, "- - - - - - - - - " , RGB(Random(75)+190, Random(255), Random(75)+190))
DrawText(20, 430, "###EMOOK IS CODING!####" , RGB(Random(75)+190, Random(255), Random(75)+190))
DrawText(20, 530, "###EMOOK IS CODING!####" , RGB(Random(75)+190, Random(255), Random(75)+190))
DrawText(20, 630, "###EMOOK IS CODING!####" , RGB(Random(75)+190, Random(255), Random(75)+190))
lastpush = ElapsedMilliseconds()
For i = 1 To #ScreenHeight Step 7 : Line(0, i, #ScreenWidth, 1 , $000000) : Line(0, i+1, #ScreenWidth, 1 , $000000) : Line(0, i+2, #ScreenWidth, 1 , $000000) :Next
StopDrawing()
EndProcedure
Procedure.f GSin(winkel)
ProcedureReturn Sin(winkel*(pix))
EndProcedure
Procedure.f GCos(winkel)
ProcedureReturn Cos(winkel*(pix))
EndProcedure
Procedure FillVect(vx1,vy1,vx2,vy2)
Shared Sprite, Destination, spr1
fill = #True
Sprite\x=vx1
Sprite\y=vy1
Destination\x=vx2
Destination\y=vy2
Repeat
UpdateSpr()
; If fill = #True
;
; ; DisplayTransparentSprite(logo,0,0)
; spr2=GrabSprite(#PB_Any,Sprite\x,Sprite\y,20,20)
; ; BuildImage(spr2,new,0)
; ; DrawImage(spr2,sprite\x,sprite\y)
; Else
DisplaySprite(spr1,Sprite\x,Sprite\y)
; EndIf
loop+1
Until loop = 200
EndProcedure
window = OpenWindow(0,0,0,#ScreenWidth,#ScreenHeight,"")
screen = OpenWindowedScreen(WindowID(0),0,0,#ScreenWidth , #ScreenHeight )
makenewlogo()
DisplayTransparentSprite(logo,0,0)
Repeat
gsinr=GSin(grad)*#Radius
gcosr=GCos(grad)*#Radius
lx1=#MiddleX-gsinr : ly1=#MiddleY-gcosr
lx2=#MiddleX+gsinr : ly2=#MiddleY+gcosr
FillVect(lx1,ly1,lx2,ly2)
grad + 2
If grad >= 180: grad = 0 :makenewlogo() : DisplayTransparentSprite(logo,0,0): EndIf
ExamineKeyboard()
WindowEvent()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)