From 21f87d8ce86f72b23e95ddeb74cba9bb4c7a62fb Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 9 Apr 2019 00:17:26 +1200 Subject: [PATCH] home --- core/mainThread.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/mainThread.java b/core/mainThread.java index be03f69..31ab17c 100644 --- a/core/mainThread.java +++ b/core/mainThread.java @@ -105,7 +105,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M } frameIndex = 0; - frameInterval = 35; + frameInterval = 28; lastDraw = 0; @@ -130,6 +130,8 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M PPT = new postProcessingThread(); Thread theTread = new Thread(PPT); + + //start threads t.start(); //dt.start(); @@ -179,7 +181,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M if(gameStarted) gameFrame++; - timeString = secondsToString(gameFrame/35); + timeString = secondsToString((int)(gameFrame*0.028)); //handle user's interaction with game GUI if(gameFrame == 1 && gameStarted){ @@ -250,6 +252,8 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M //g2.setColor(Color.WHITE); //g2.drawString("FPS: " + framePerSecond + " " + "Polygons: " + theAssetManager.polygonCount + " " + "Thread1 Sleep: " + sleepTime + "ms " + "Thread2 Sleep: " + postProcessingThread.sleepTime + "ms " , 5, 15); + System.out.println(framePerSecond); + //copy the screen buffer to video memory g.drawImage(bf, 0, 0, this); }