Fandom

Pico-8 Wiki

Flip

162pages on
this wiki
Add New Page
Comments2 Share
flip( )

Copies the graphics buffer to the screen, then synchronizes to the next frame at 30 frames per second.

Carts that use the built-in game loop functions _update() and _draw() do not need to call flip(). You can use flip() if you want to implement your own game loop and still synchronize to the 30 frames per second draw timer.

Note: If the _draw() game loop is not used by the program, Pico-8 will copy the graphics buffer to the screen 30 times per second automatically even if flip() is not called as often. flip() waits until the next frame has been copied, synchronizing program execution to the frame timer.

Examples Edit

for x=4,124 do
  cls()
  circfill(x, x, 4, 8)
  flip()
end

This example animates a circle moving diagonally across the screen, one pixel per frame for 120 frames (four seconds).

If you remove the call to flip(), this clears the graphics buffer and draws the circle 120 times, but the buffer is only copied to the screen when the program exits.

See also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.