I say hello on my own terms, WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
public static void update() { switch(gameState) { case MAINMENU: if (mainMenu == null) mainMenu = new MainMenu(); mainMenu.update(); break; case GAME: if (game == null) game = new Game(map); game.update(); break; case EDITOR: if (editor == null) editor = new Editor(); editor.update(); break; } long currentTime = System.currentTimeMillis(); if (currentTime > nextSecond) { nextSecond += 1000; framesInLastSecond = framesInCurrentSecond; framesInCurrentSecond = 0; } framesInCurrentSecond++; System.out.println(framesInLastSecond + " fps"); } |