Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Game Loop - Using Timer instead of "while()"?

Game Loop - Using Timer instead of "while()"?

Put your problem here if it does not fit any of the other categories.

Game Loop - Using Timer instead of "while()"?

Postby Don Pipo » Wed Feb 09, 2011 11:58 am

Hi everybody!

I try to move from Flash/AS3 to Android/Java and read a lot of tutorials in the last days. If I stumble over Android game tutorials I always find something like this:

Code: Select all
public void run() {
    Canvas c;
    while (_run) {
        c = null;
        try {
            c = _surfaceHolder.lockCanvas(null);
            synchronized (_surfaceHolder) {
                // simulate and render game here
            }
        } finally {
            // don't leave the Surface in an
            // inconsistent state
        }
    }
}


I have never seen a game loop created with "while()" in Flash. In Flash I used a Timer-class to create my game loop. Does this have a Android or Java related reason?

Thanks!
Pipo
Don Pipo
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Feb 09, 2011 11:42 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests