Und wie bekomme ich dann folgendes Konstrukt (gekürzt) aus der Hilfe hin, ohne dass die CPU 100% frisst? Weil WaitWindowEvent() mit Zeitangabe macht Probleme, wenn nebenbei noch ein Timer läuft.
Code: Alles auswählen
Repeat
Repeat
; Always process all the events to flush the queue at every frame
Event = WindowEvent()
Select Event
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
; Do the normal application management here
EndSelect
Until Event = 0 ; Quit the event loop only when no more events are available
; Clear the screen and draw our sprites
ClearScreen(RGB(0,0,0))
ClipSprite(0, 0, 0, x, x/8)
DisplaySprite(0, x, 100)
DisplaySprite(0, x, x)
DisplaySprite(0, 300-x, x)
DisplaySprite(0, playerX, playerY)
FlipBuffers() ; Inverse the buffers (the back become the front (visible)... and we can do the rendering on the back
;<< hier würd ich mit einem Delay(1) die CPU-Last verringern
Until Quit Or KeyboardPushed(#PB_Key_Escape)