Eintragung der durchspielten levels, level003 und 004 hinzugefügt

This commit is contained in:
Armin Benz 2017-08-17 23:21:25 +02:00
parent 71fddd2079
commit 56ccb73055
8 changed files with 43075 additions and 3001 deletions

View File

@ -7635,13 +7635,13 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -8135,7 +8135,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="13"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -8572,6 +8572,10 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -8619,23 +8623,19 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9037,31 +9037,18 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9082,8 +9069,20 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9124,6 +9123,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="24"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9529,93 +9529,17 @@
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="0"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9624,6 +9548,28 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="13"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9636,6 +9582,48 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="33"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="24"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -9653,6 +9641,18 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="22"/>
<tile gid="23"/>
<tile gid="23"/>
<tile gid="23"/>
@ -14027,7 +14027,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14090,7 +14089,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14158,15 +14156,14 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14527,7 +14524,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14590,7 +14586,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14658,7 +14653,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -14669,6 +14663,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15027,7 +15022,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15090,7 +15084,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15158,7 +15151,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15171,6 +15163,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15527,7 +15520,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15590,7 +15582,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15658,7 +15649,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -15673,6 +15663,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16027,7 +16018,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16090,7 +16080,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16158,7 +16147,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16175,6 +16163,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16527,7 +16516,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16590,7 +16578,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16658,7 +16645,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -16677,6 +16663,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17027,7 +17014,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17090,7 +17076,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17158,7 +17143,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17179,6 +17163,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17527,7 +17512,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17590,7 +17574,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17658,7 +17641,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -17681,6 +17663,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18027,7 +18010,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18090,7 +18072,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18158,7 +18139,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18183,6 +18163,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18527,7 +18508,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18590,7 +18570,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18658,7 +18637,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -18685,6 +18663,7 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -19027,7 +19006,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="19"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -19090,7 +19068,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -19158,12 +19135,36 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="17"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="16"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="20"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
@ -19590,7 +19591,6 @@
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="18"/>
<tile gid="0"/>
<tile gid="0"/>
<tile gid="0"/>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,10 @@ package de.samdev.colorrunner.game.world.entities.gameentities;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.graphics.Texture;
import de.samdev.colorrunner.CRGame;
import de.samdev.colorrunner.game.renderer.CRAssets;
import de.samdev.colorrunner.game.world.CRGameWorld;
import de.samdev.colorrunner.game.world.SwipeDirection;
@ -15,7 +17,11 @@ import de.samdev.colorrunner.game.world.entities.gameentities.controller.RunBott
import de.samdev.colorrunner.game.world.entities.gameentities.controller.FlyPlayerController;
import de.samdev.colorrunner.game.world.entities.gameentities.controller.RunTopPlayerController;
import de.samdev.colorrunner.game.world.entities.gameentities.floor.FloorTileEntity;
import de.samdev.colorrunner.game.world.map.CRMapStorage;
import de.samdev.colorrunner.game.world.map.provider.MapProvider;
import de.samdev.colorrunner.game.world.map.provider.StaticMapProvider;
import de.samdev.colorrunner.game.world.map.provider.TriggerType;
import de.samdev.colorrunner.screens.gameScreen.GameScreen;
import de.samdev.colorrunner.screens.menu.MainMenu;
public class PlayerEntity extends MovingEntity {
@ -31,6 +37,8 @@ public class PlayerEntity extends MovingEntity {
private AbstractPlayerController controller;
private Preferences ingameprefs = Gdx.app.getPreferences("ingamepreferences");
public PlayerEntity(CRGameWorld _owner, float x, float y) {
super(_owner, x, y, PLAYER_WIDTH, PLAYER_HEIGHT);
@ -59,7 +67,25 @@ public class PlayerEntity extends MovingEntity {
if (controller.getControllerType() != ControllingType.GRAVITY) controller = new GravityPlayerController(this);
break;
case END:
((Game)Gdx.app.getApplicationListener()).setScreen(new MainMenu());
//((Game)Gdx.app.getApplicationListener()).setScreen(new MainMenu());
int currantlvl = ingameprefs.getInteger("currantlvl", 1);
currantlvl++;
int highestlevel = ingameprefs.getInteger("highestlevel", 1);
if(currantlvl > highestlevel)
highestlevel = currantlvl;
ingameprefs.putInteger("highestlevel", highestlevel);
ingameprefs.putInteger("currantlvl", currantlvl);
ingameprefs.flush();
if(currantlvl == 4)
((Game)Gdx.app.getApplicationListener()).setScreen(new MainMenu());
else
CRGame.Inst().setScreen(new GameScreen(new StaticMapProvider(CRMapStorage.map_map.get(currantlvl))));
world.music.stop();
break;
}

View File

@ -3,13 +3,15 @@ package de.samdev.colorrunner.game.world.map;
import com.badlogic.gdx.Gdx;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class CRMapStorage {
public static final List<CRTiledMap> maps = new ArrayList<CRTiledMap>();
public static final CRTiledMap map_start = load("map_pieces", "p00_start.tmx");
public static final CRTiledMap map_start = internalload("map_pieces", "p00_start.tmx", false);
public static final CRTiledMap map_01 = register("map_pieces", "p01.tmx");
public static final CRTiledMap map_02 = register("map_pieces", "p02.tmx");
@ -38,10 +40,19 @@ public class CRMapStorage {
public static final CRTiledMap map_25 = register("map_pieces", "p25.tmx");
public static final CRTiledMap map_26 = register("map_pieces", "p26.tmx");
public static final CRTiledMap lvl_01 = load("levels", "plevel001.tmx");
public static final CRTiledMap lvl_01 = load("levels", 1, "plevel001.tmx");
public static final CRTiledMap lvl_02 = load("levels", 2, "plevel002.tmx");
public static final CRTiledMap lvl_03 = load("levels", 3, "plevel003.tmx");
public static final CRTiledMap lvl_04 = load("levels", 4, "plevel004.tmx");
private static CRTiledMap load(String folder, String path) {
return internalload(folder, path, false);
public static Map<Integer, CRTiledMap> map_map;
private static CRTiledMap load(String folder, int mid, String path) {
if (map_map == null) map_map = new HashMap<Integer, CRTiledMap>();
CRTiledMap m = internalload(folder, path, false);
map_map.put(mid, m);
return m;
}
private static CRTiledMap register(String folder, String path) {

View File

@ -4,6 +4,7 @@ package de.samdev.colorrunner.game.world.map.provider;
import com.badlogic.gdx.math.Rectangle;
import de.samdev.colorrunner.game.world.CRGameWorld;
import de.samdev.colorrunner.game.world.map.CRTiledMap;
public abstract class MapProvider {
public abstract void init(CRGameWorld world);

View File

@ -25,6 +25,7 @@ import de.samdev.colorrunner.screens.gameScreen.GameScreen;
public class MainMenu implements Screen {
private Preferences prefs = Gdx.app.getPreferences("settings");
private Preferences ingameprefs = Gdx.app.getPreferences("ingamepreferences");
private Stage stage = new Stage();
private Table table = new Table();
@ -35,13 +36,12 @@ public class MainMenu implements Screen {
new TextureAtlas(Gdx.files.internal("skins/menuSkin.pack")));
private TextButton buttonPlay1 = new TextButton("Play Level 1", skin);
private TextButton buttonPlay1 = new TextButton("Play Levels", skin);
private TextButton buttonPlay2 = new TextButton("Play Endless", skin);
private TextButton buttonOption = new TextButton("Option", skin);
private TextButton buttonExit = new TextButton("Exit", skin);
// folgendes mal als Beispiel :)
/*
button3.setSize(col_width*4,(float)(row_height*2));
@ -64,7 +64,8 @@ button3.addListener(new InputListener(){
*/
private Label title = new Label("Color Runner", skin);
private Label title = new Label("Color Runner" , skin);
private Label highestscore = new Label("Highest Level: " + ingameprefs.getInteger("highestlevel", 1), skin);
public Music music;
@ -107,7 +108,13 @@ button3.addListener(new InputListener(){
buttonPlay1.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y){
CRGame.Inst().setScreen(new GameScreen(new StaticMapProvider(CRMapStorage.lvl_01)));
//int level = ingameprefs.getInteger("highestlevel", 1);
ingameprefs.putInteger("currantlvl", 1);
int currantlvl = ingameprefs.getInteger("currantlvl", 1);
CRGame.Inst().setScreen(new GameScreen(new StaticMapProvider(CRMapStorage.map_map.get(currantlvl))));
music.stop();
}
});
@ -136,7 +143,8 @@ button3.addListener(new InputListener(){
table.add(buttonPlay1).size((int)((double)Gdx.graphics.getWidth() / 2.0D),250);
table.add(buttonPlay2).size((int)((double)Gdx.graphics.getWidth() / 2.0D),250).row();
table.add(title).expand().row();
table.add(title).size((int)((double)Gdx.graphics.getWidth() / 2.0D), 62);
table.add(highestscore).size((int)((double)Gdx.graphics.getWidth() / 2.0D),62).row();
table.add(buttonOption).size((int)((double)Gdx.graphics.getWidth() / 2.0D),250);
table.add(buttonExit).size((int)((double)Gdx.graphics.getWidth() / 2.0D),250);