Difference between revisions of "Gb.update"
From Gamebuino Wiki
m |
m ({{lowercase}} title template added) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{lowercase}} |
__NOTOC__ | __NOTOC__ | ||
− | = Description = | + | == Description == |
Returns true and updates everything (display, sound, batter monitor, etc.) at a fixed frequency (20 times per second by default). | 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". | It should be used in a specific conditional structure, see "Syntax". | ||
− | = Syntax = | + | == Syntax == |
<pre> | <pre> | ||
while(1){ | while(1){ | ||
Line 15: | Line 15: | ||
</pre> | </pre> | ||
− | = Parameters = | + | == Parameters == |
none | none | ||
− | = Returns = | + | == Returns == |
boolean: true if enough time has elapsed since the last frame (20 frames per second = 50ms per frame). | boolean: true if enough time has elapsed since the last frame (20 frames per second = 50ms per frame). | ||
− | = 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]] |
Latest revision as of 2014-05-20T21:00:27
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