Difference between revisions of "Gb.update"
From Gamebuino Wiki
(Changed title depth) |
(→Example: source from github) |
||
Line 22: | Line 22: | ||
== Example == | == Example == | ||
− | < | + | <gistit>https://github.com/Rodot/Gamebuino/blob/master/libraries/Gamebuino/examples/5.Reference/core/update/update.ino</gistit> |
− | |||
− | |||
− | Gamebuino | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </ | ||
== See also == | == See also == | ||
*[[gb.begin]] | *[[gb.begin]] | ||
*[[gb.setFrameRate]] | *[[gb.setFrameRate]] |
Revision as of 2014-05-19T09:32:53
Description
Returns true and updates everything (display, sound, batter monitor, etc.) at a fixed frequency (20 times per second by default).
It should be used in a specific conditional structure, see "Syntax".
Syntax
while(1){ if(gb.update()){ //your game here } }
Parameters
none
Returns
boolean: true if enough time has elapsed since the last frame (20 frames per second = 50ms per frame).
Example