gb.update

From Gamebuino Wiki
Revision as of 2014-05-19T08:32:53 by Rodot (talk | contribs) (Example: source from github)
Jump to: navigation, search


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

See also