summaryrefslogtreecommitdiff
path: root/core/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/com')
-rw-r--r--core/src/com/ilotterytea/maxoning/MaxonGame.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/src/com/ilotterytea/maxoning/MaxonGame.java b/core/src/com/ilotterytea/maxoning/MaxonGame.java
index 84bc6e6..ee59fa9 100644
--- a/core/src/com/ilotterytea/maxoning/MaxonGame.java
+++ b/core/src/com/ilotterytea/maxoning/MaxonGame.java
@@ -1,13 +1,20 @@
package com.ilotterytea.maxoning;
import com.badlogic.gdx.Game;
+import com.badlogic.gdx.Gdx;
+import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
+import com.ilotterytea.maxoning.player.MaxonPlayer;
import com.ilotterytea.maxoning.screens.AssetLoadingScreen;
+import com.ilotterytea.maxoning.utils.serialization.GameDataSystem;
+
+import java.io.IOException;
public class MaxonGame extends Game {
public SpriteBatch batch;
public AssetManager assetManager;
+ public Preferences prefs;
private static MaxonGame instance;
@@ -21,8 +28,18 @@ public class MaxonGame extends Game {
@Override
public void create () {
batch = new SpriteBatch();
+ prefs = Gdx.app.getPreferences("Maxoning");
+
+ if (!GameDataSystem.exists()) {
+ try {
+ GameDataSystem.SaveData(new MaxonPlayer());
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
assetManager = new AssetManager();
+
this.setScreen(new AssetLoadingScreen(this));
}
@@ -40,4 +57,8 @@ public class MaxonGame extends Game {
assetManager.dispose();
instance.dispose();
}
+
+ public void registerItems() {
+
+ }
}