Hi there,
I am trying to make it so every time the user dies, the score will be added into a text file. At the moment this file gets made, but when I replay the game it overwrites everything saved into it. I am wanting to make it, so it adds text onto the file, and you can look back at all the games instead of it overwriting...
Any help would be really appreciated, thanks!
FileWriter fw = null; try { fw = new FileWriter("scores.txt", false); fw.write( Calendar.getInstance().getTime() + " | Score: " + score + " (" + lives + " Lives Left)" ); } catch (Exception e){ e.printStackTrace(); } finally { if(fw != null) { try { fw.close(); } catch (Exception e) { e.printStackTrace(); } } }