Extract game start point configuration to database
This commit is contained in:
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
package com.bartlomiejpluta.demo.runner;
|
package com.bartlomiejpluta.demo.runner;
|
||||||
|
|
||||||
|
import DB.dao;
|
||||||
import com.bartlomiejpluta.base.api.context.Context;
|
import com.bartlomiejpluta.base.api.context.Context;
|
||||||
import com.bartlomiejpluta.base.api.gui.GUI;
|
import com.bartlomiejpluta.base.api.gui.GUI;
|
||||||
import com.bartlomiejpluta.base.api.runner.GameRunner;
|
import com.bartlomiejpluta.base.api.runner.GameRunner;
|
||||||
@@ -10,6 +11,8 @@ import lombok.Getter;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static java.lang.Integer.parseInt;
|
||||||
|
|
||||||
|
|
||||||
public class DemoRunner implements GameRunner {
|
public class DemoRunner implements GameRunner {
|
||||||
private static final Logger log = LoggerFactory.getLogger(DemoRunner.class);
|
private static final Logger log = LoggerFactory.getLogger(DemoRunner.class);
|
||||||
@@ -36,7 +39,7 @@ public class DemoRunner implements GameRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void configureCamera() {
|
private void configureCamera() {
|
||||||
context.getCamera().setScale(2f);
|
context.getCamera().setScale(1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMenu() {
|
private void initMenu() {
|
||||||
@@ -59,9 +62,11 @@ public class DemoRunner implements GameRunner {
|
|||||||
guiManager.closeAll();
|
guiManager.closeAll();
|
||||||
guiManager.enableGameMenu();
|
guiManager.enableGameMenu();
|
||||||
player.reset();
|
player.reset();
|
||||||
context.openMap(A.maps.hero_home.uid);
|
var start = dao.start_game.find((short) 1);
|
||||||
context.getMap().getObjectLayer(A.maps.hero_home.layers.main).addEntity(this.player);
|
var startPoint = start.getStartPoint().split(",");
|
||||||
player.setCoordinates(11, 14);
|
context.openMap(A.maps.get(startPoint[0]).uid);
|
||||||
|
context.getMap().getObjectLayer(A.maps.getLayer(startPoint[0], startPoint[1])).addEntity(this.player);
|
||||||
|
player.setCoordinates(parseInt(startPoint[2]), parseInt(startPoint[3]));
|
||||||
context.resume();
|
context.resume();
|
||||||
hud.show();
|
hud.show();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user