

Code : Tout sélectionner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Coded with Purebasic v.6.0 by threedslider 24/07/2022
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
InitSprite()
InitKeyboard()
OpenWindow(1, 0,0,800,600,"Spiral in moving", #PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(1),0,0,800,600,0,0,0)
SetFrameRate(30)
Repeat
ExamineKeyboard()
event = WindowEvent()
ClearScreen(RGB(0,0,0))
StartDrawing(ScreenOutput())
For x = 0 To 3600
move.f + 1/10000
spiral_x.f = 100 * Exp((move-x)/200)*Cos(move+x)
spiral_y.f = 100 * Exp((move-x)/200)*Sin(move+x)
Line( spiral_x+400, spiral_y+300, 1, 3, RGB(255, 0, 0) )
Next
StopDrawing()
Delay(1) : FlipBuffers()
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End