Run garbage collector when game is reset or started

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2, Sig, Sigo 2022-06-09 19:16:41 +00:00 committed by GitHub
parent effdf8b79f
commit 27d5e9ec64
3 changed files with 2 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -155,9 +155,11 @@ public class RabiClone{
player=null;
level_renderer=null;
control_settings_menu=null;
System.gc();
}
private static void StartGame() {
System.gc();
OBJ.add(player = new Player(p));
OBJ.add(new Erinoah(p));
}
@ -181,11 +183,6 @@ public class RabiClone{
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
if (System.currentTimeMillis()-lastReportedTime>1000) {
System.err.println("WARNING! Update loop is underperforming!");
lastReportedTime=System.currentTimeMillis();
}
}
lastUpdate=newTime;
}