Created
June 8, 2012 17:19
-
-
Save Jimshii/2896965 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class load { | |
static int savedA = 0; | |
public static void loadGame() { | |
try{ | |
// Open file to read from, named GameData.sav. | |
FileInputStream saveFile = new FileInputStream("GameData.sav"); | |
// Create an ObjectInputStream to get objects from save file. | |
ObjectInputStream save = new ObjectInputStream(saveFile); | |
// Close the file. | |
save.close(); // This also closes saveFile. | |
} | |
catch(Exception exc){ | |
exc.printStackTrace(); // If there was an error, print the info. | |
} | |
System.out.println(Character.name); | |
System.out.println(Character.health); | |
System.out.println(Character.mana); | |
System.out.println(Character.stamina); | |
System.out.println(Character.focus); | |
System.out.println(Character.gold); | |
System.out.println(Character.xp); | |
System.out.println(Character.level); | |
System.out.println(Character.secondBar); | |
System.out.println(Character.usable); | |
System.out.println(Character.strength); | |
System.out.println(Character.endurance); | |
System.out.println(Character.intelligence); | |
System.out.println(Character.wisdom); | |
System.out.println(Character.dexterity); | |
System.out.println(Character.concentration); | |
System.out.println(Character.charisma); | |
System.out.println(Character.intimidation); | |
System.out.println(Character.race); | |
System.out.println(load.savedA); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment