
Code : Tout sélectionner
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Coded with Purebasic v.6.0 by threedslider 15/05/2023
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Test for Helix in fake 3D :)
InitSprite()
InitKeyboard()
OpenWindow(1, 0,0,800,600,"Helix", #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 360
move.f + 1/10000
helix_x.f = 100 *Cos(move+x)
helix_y.f = 10 *(move-x)
Box( helix_x+400, helix_y, 5, 5, RGB(255, 0, 0) )
Next
StopDrawing()
Delay(1) : FlipBuffers()
Until event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End