Mon Jul 25, 2016 8:40 am
Mon Jul 25, 2016 9:06 am
Mon Jul 25, 2016 9:12 am
Mon Jul 25, 2016 11:50 am
Mon Jul 25, 2016 1:08 pm
Mon Jul 25, 2016 1:22 pm
void loop(){
if(gb.update()){
if(gb.frameCount < 40){
blah blah
}else if(gb.frameCount < 80){
blah blah
}
}
}
Mon Jul 25, 2016 1:35 pm
rodot wrote:You shouldn't use delay as it blocks everything happening in the background (in gb.update() actually) : sound, backlight, battery monitoring, buttons, etc, so you Gamebuino will be completely unresponsive for the duration of the delay. For example the user won't be able to skip the dialog or to get back to the menu.
[...]
noah wrote:Yeah it is, thanks. I never worked out what micro and milliseconds actually accounted for in terms of a second, but delay(1000) make it pause for 1 second. I guess that's milliseconds?
noah wrote:well... that didn't work. I looked at the example but that shows a blink.
I tried
- Code:
void loop(){
if(gb.update()){
if(gb.frameCount < 40){
blah blah
}else if(gb.frameCount < 80){
blah blah
}
}
}
...but this didn't work, I'm assuming because I stayed more than two seconds on the title screen. What is the best way of implementing this, I just wanted a wait?!
void wait(byte frames){
gb.frameCount = 0; // reset the framecount
while(gb.frameCount < frames){ // repeat the next until the framecount is equal to how many frames we want to wait
while(!gb.update()); // wait until things need updating
// right here you would put things to update the screen, if it got erased, that is (configurable via gb.display.persistence )
}
}
void wait(int frames){
frames += gb.frameCount;
while(gb.frameCount < frames){
while(!gb.update());
}
}
Mon Jul 25, 2016 1:41 pm
Mon Jul 25, 2016 1:45 pm
Mon Jul 25, 2016 1:52 pm