File saving is work in progress

Added a css file for the game
Made it so that you can press enter to continue forwars
Made folder for both images and save files
This commit is contained in:
2019-03-23 03:37:41 -06:00
parent 0bedf3e182
commit e6e1f02ea9
10 changed files with 70 additions and 2 deletions

33
src/FileSaving.java Normal file
View File

@@ -0,0 +1,33 @@
import java.io.*;
public class FileSaving extends Player {
InputStream in = null;
BufferedReader reader = null;
OutputStream out = null;
public Boolean loadFile() {
try {
in = new FileInputStream("src/saves/playerSave.txt");
reader = new BufferedReader(new InputStreamReader(in));
//Returns true if there is a save file
return true;
}
catch (Exception e){
//returns false if there isn't a save file
return false;
}
}
public void saveFile(){
try{
out = new FileOutputStream("src/saves/playerSave.txt");
}
catch (Exception e){
}
}
}