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:
33
src/FileSaving.java
Normal file
33
src/FileSaving.java
Normal 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){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user