PICO-8 Wiki
(Adding categories)
Tag: categoryselect
(Added see also)
Tags: Visual edit apiedit
Line 13: Line 13:
 
Draw is where the graphics are handled. Here you can make calls to other functions to help manage game state, or you can handle all drawing directly inside of the _draw() function. _draw() can be skipped during a frame, however, should the calculations and draw time combined take longer than a 1/30th second window.
 
Draw is where the graphics are handled. Here you can make calls to other functions to help manage game state, or you can handle all drawing directly inside of the _draw() function. _draw() can be skipped during a frame, however, should the calculations and draw time combined take longer than a 1/30th second window.
   
  +
=== See Also: ===
==== See the main articles for more information on each step. ====
 
  +
* [[Init]]
  +
* [[Update]]
  +
* [[Draw]]
  +
  +
======<nowiki/>======
 
[[Category:Reference]]
 
[[Category:Reference]]
 
[[Category:API]]
 
[[Category:API]]

Revision as of 16:44, 21 June 2016

Game Loop

A Game Loop refers to the steps taken in order while a game is running.

Pico-8 divides this into three major steps, Init, Update, and Draw. The Update-Draw loop runs 30 times per second.

Init

Init is arguably not a part of the game loop, because it happens before the loop begins, however, it's still important as part of the overall architecture. Init can be called later to reinitialize a cartridge, as a handy reset button.

Update

Update is where you will store your game logic. Input and audio are handled here, as well as the calculations to bring the game to the next step. Update runs every frame, and is never skipped (unlike _draw(), which can be skipped).

Draw

Draw is where the graphics are handled. Here you can make calls to other functions to help manage game state, or you can handle all drawing directly inside of the _draw() function. _draw() can be skipped during a frame, however, should the calculations and draw time combined take longer than a 1/30th second window.

See Also: