Merge branch 'dev/client_beck' into 'dev/client'
Added basic display of bonusCards for presentation on Monday See merge request progproj/gruppen-ht24/Gruppe-01!10
This commit was merged in pull request #10.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
package pp.mdga.client.board;
|
package pp.mdga.client;
|
||||||
|
|
||||||
enum BoardAsset {
|
public enum Asset {
|
||||||
bigTent,
|
bigTent,
|
||||||
cardStack,
|
cardStack,
|
||||||
cir,
|
cir,
|
||||||
@@ -20,43 +20,44 @@ enum BoardAsset {
|
|||||||
node_start("./node_normal/node_normal.j3o", "./node_normal/node_start_diff.png"),
|
node_start("./node_normal/node_normal.j3o", "./node_normal/node_start_diff.png"),
|
||||||
node_bonus("./node_normal/node_normal.j3o", "./node_normal/node_bonus_diff.png"),
|
node_bonus("./node_normal/node_normal.j3o", "./node_normal/node_bonus_diff.png"),
|
||||||
radar,
|
radar,
|
||||||
shieldCard,
|
|
||||||
ship(0.8f),
|
ship(0.8f),
|
||||||
smallTent,
|
smallTent,
|
||||||
swapCard,
|
|
||||||
tank,
|
tank,
|
||||||
turboCard,
|
|
||||||
// world(1.2f),
|
// world(1.2f),
|
||||||
world("./world_new/world_export_new.obj", "./world_new/world_new_diff.png", 1.2f),
|
world("./world_new/world_export_new.obj", "./world_new/world_new_diff.png", 1.2f),
|
||||||
shield_ring("./shield_ring/shield_ring.obj", null),
|
shield_ring("./shield_ring/shield_ring.obj", null),
|
||||||
tree_small("./tree_small/tree_small.obj", "./tree_small/tree_small_diff.png"),
|
tree_small("./tree_small/tree_small.obj", "./tree_small/tree_small_diff.png"),
|
||||||
tree_big("./tree_big/tree_big.obj", "./tree_big/tree_big_diff.png");
|
tree_big("./tree_big/tree_big.obj", "./tree_big/tree_big_diff.png"),
|
||||||
|
turboCard,
|
||||||
|
swapCard,
|
||||||
|
shieldCard
|
||||||
|
;
|
||||||
|
|
||||||
private final String modelPath;
|
private final String modelPath;
|
||||||
private final String diffPath;
|
private final String diffPath;
|
||||||
private final float size;
|
private final float size;
|
||||||
|
|
||||||
BoardAsset() {
|
Asset() {
|
||||||
String folderFileName = "./" + name() + "/" + name();
|
String folderFileName = "./" + name() + "/" + name();
|
||||||
this.modelPath = folderFileName + ".j3o";
|
this.modelPath = folderFileName + ".j3o";
|
||||||
this.diffPath = folderFileName + "_diff.png";
|
this.diffPath = folderFileName + "_diff.png";
|
||||||
this.size = 1f;
|
this.size = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardAsset(String modelPath, String diffPath) {
|
Asset(String modelPath, String diffPath) {
|
||||||
this.modelPath = modelPath;
|
this.modelPath = modelPath;
|
||||||
this.diffPath = diffPath;
|
this.diffPath = diffPath;
|
||||||
this.size = 1f;
|
this.size = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardAsset(float size) {
|
Asset(float size) {
|
||||||
String folderFileName = "./" + name() + "/" + name();
|
String folderFileName = "./" + name() + "/" + name();
|
||||||
this.modelPath = folderFileName + ".j3o";
|
this.modelPath = folderFileName + ".j3o";
|
||||||
this.diffPath = folderFileName + "_diff.png";
|
this.diffPath = folderFileName + "_diff.png";
|
||||||
this.size = size;
|
this.size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
BoardAsset(String modelPath, String diffPath, float size){
|
Asset(String modelPath, String diffPath, float size){
|
||||||
this.modelPath = modelPath;
|
this.modelPath = modelPath;
|
||||||
this.diffPath = diffPath;
|
this.diffPath = diffPath;
|
||||||
this.size = size;
|
this.size = size;
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
import pp.mdga.client.animation.AnimationHandler;
|
import pp.mdga.client.animation.AnimationHandler;
|
||||||
import com.jme3.system.AppSettings;
|
import com.jme3.system.AppSettings;
|
||||||
import pp.mdga.client.view.*;
|
import pp.mdga.client.view.*;
|
||||||
import pp.mdga.game.Color;
|
|
||||||
import pp.mdga.notification.TskSelectNotification;
|
|
||||||
|
|
||||||
public class MdgaApp extends SimpleApplication {
|
public class MdgaApp extends SimpleApplication {
|
||||||
private AnimationHandler animationHandler;
|
private AnimationHandler animationHandler;
|
||||||
@@ -17,9 +15,9 @@ public class MdgaApp extends SimpleApplication {
|
|||||||
private ModelSyncronizer modelSyncronizer;
|
private ModelSyncronizer modelSyncronizer;
|
||||||
|
|
||||||
MdgaView view = null;
|
MdgaView view = null;
|
||||||
private MdgaState state = MdgaState.MAIN;
|
private MdgaState state = MdgaState.GAME;
|
||||||
|
|
||||||
private static float resolutionFactor = 1;
|
private static float resolutionFactor = 1f;
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
AppSettings settings = new AppSettings(true);
|
AppSettings settings = new AppSettings(true);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
package pp.mdga.client.board;
|
package pp.mdga.client.board;
|
||||||
|
|
||||||
record AssetOnMap(BoardAsset asset, int x, int y, float rot) {}
|
import pp.mdga.client.Asset;
|
||||||
|
|
||||||
|
record AssetOnMap(Asset asset, int x, int y, float rot) {}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package pp.mdga.client.board;
|
package pp.mdga.client.board;
|
||||||
|
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
import com.jme3.math.ColorRGBA;
|
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.post.FilterPostProcessor;
|
import com.jme3.post.FilterPostProcessor;
|
||||||
import com.jme3.renderer.queue.RenderQueue;
|
import com.jme3.renderer.queue.RenderQueue;
|
||||||
import com.jme3.scene.Node;
|
import com.jme3.scene.Node;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.scene.control.AbstractControl;
|
import com.jme3.scene.control.AbstractControl;
|
||||||
|
import pp.mdga.client.Asset;
|
||||||
import pp.mdga.client.MdgaApp;
|
import pp.mdga.client.MdgaApp;
|
||||||
import pp.mdga.game.Color;
|
import pp.mdga.game.Color;
|
||||||
|
|
||||||
@@ -70,10 +70,10 @@ private void initMap() {
|
|||||||
|
|
||||||
for (AssetOnMap assetOnMap : assetOnMaps) {
|
for (AssetOnMap assetOnMap : assetOnMaps) {
|
||||||
switch (assetOnMap.asset()) {
|
switch (assetOnMap.asset()) {
|
||||||
case lw -> addFigureToPlayerMap(assetToColor(BoardAsset.lw), assetOnMap);
|
case lw -> addFigureToPlayerMap(assetToColor(Asset.lw), assetOnMap);
|
||||||
case heer -> addFigureToPlayerMap(assetToColor(BoardAsset.heer), assetOnMap);
|
case heer -> addFigureToPlayerMap(assetToColor(Asset.heer), assetOnMap);
|
||||||
case cir -> addFigureToPlayerMap(assetToColor(BoardAsset.cir), assetOnMap);
|
case cir -> addFigureToPlayerMap(assetToColor(Asset.cir), assetOnMap);
|
||||||
case marine -> addFigureToPlayerMap(assetToColor(BoardAsset.marine), assetOnMap);
|
case marine -> addFigureToPlayerMap(assetToColor(Asset.marine), assetOnMap);
|
||||||
case node_normal, node_bonus, node_start ->
|
case node_normal, node_bonus, node_start ->
|
||||||
infield.add(displayAndControl(assetOnMap, new NodeControl()));
|
infield.add(displayAndControl(assetOnMap, new NodeControl()));
|
||||||
case node_home_black -> addHomeNode(homeNodesMap, Color.AIRFORCE, assetOnMap);
|
case node_home_black -> addHomeNode(homeNodesMap, Color.AIRFORCE, assetOnMap);
|
||||||
@@ -90,7 +90,7 @@ private void initMap() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color assetToColor(BoardAsset asset) {
|
private Color assetToColor(Asset asset) {
|
||||||
return switch (asset) {
|
return switch (asset) {
|
||||||
case lw -> Color.AIRFORCE;
|
case lw -> Color.AIRFORCE;
|
||||||
case heer -> Color.ARMY;
|
case heer -> Color.ARMY;
|
||||||
@@ -100,7 +100,7 @@ private Color assetToColor(BoardAsset asset) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private Spatial createModel(BoardAsset asset, Vector3f pos, float rot) {
|
private Spatial createModel(Asset asset, Vector3f pos, float rot) {
|
||||||
String modelName = asset.getModelPath();
|
String modelName = asset.getModelPath();
|
||||||
String texName = asset.getDiffPath();
|
String texName = asset.getDiffPath();
|
||||||
Spatial model = app.getAssetManager().loadModel(modelName);
|
Spatial model = app.getAssetManager().loadModel(modelName);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public CameraHandler(MdgaApp app, FilterPostProcessor fpp){
|
|||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
app.getFlyByCamera().setEnabled(true);
|
app.getFlyByCamera().setEnabled(true);
|
||||||
int zoom = 15;
|
int zoom = 20;
|
||||||
app.getCamera().setLocation(new Vector3f(-zoom, 0, zoom));
|
app.getCamera().setLocation(new Vector3f(-zoom, 0, zoom));
|
||||||
app.getCamera().lookAt(new Vector3f(0, 0, 0), new Vector3f(0, 0, 1));
|
app.getCamera().lookAt(new Vector3f(0, 0, 0), new Vector3f(0, 0, 1));
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package pp.mdga.client.board;
|
package pp.mdga.client.board;
|
||||||
|
|
||||||
|
|
||||||
|
import pp.mdga.client.Asset;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@@ -43,7 +46,7 @@ public static List<AssetOnMap> loadMap(String mapName) {
|
|||||||
|
|
||||||
float rot = Float.parseFloat(parts[2]);
|
float rot = Float.parseFloat(parts[2]);
|
||||||
|
|
||||||
BoardAsset asset = getLoadedAsset(assetName);
|
Asset asset = getLoadedAsset(assetName);
|
||||||
assetsOnMap.add(new AssetOnMap(asset, x, y, rot));
|
assetsOnMap.add(new AssetOnMap(asset, x, y, rot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,32 +60,32 @@ public static List<AssetOnMap> loadMap(String mapName) {
|
|||||||
return assetsOnMap;
|
return assetsOnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BoardAsset getLoadedAsset(String assetName) {
|
private static Asset getLoadedAsset(String assetName) {
|
||||||
return switch (assetName) {
|
return switch (assetName) {
|
||||||
case "lw" -> BoardAsset.lw;
|
case "lw" -> Asset.lw;
|
||||||
case "cir" -> BoardAsset.cir;
|
case "cir" -> Asset.cir;
|
||||||
case "marine" -> BoardAsset.marine;
|
case "marine" -> Asset.marine;
|
||||||
case "heer" -> BoardAsset.heer;
|
case "heer" -> Asset.heer;
|
||||||
case "node" -> BoardAsset.node_normal;
|
case "node" -> Asset.node_normal;
|
||||||
case "node_start" -> BoardAsset.node_start;
|
case "node_start" -> Asset.node_start;
|
||||||
case "node_bonus" -> BoardAsset.node_bonus;
|
case "node_bonus" -> Asset.node_bonus;
|
||||||
case "node_home_blue" -> BoardAsset.node_home_blue;
|
case "node_home_blue" -> Asset.node_home_blue;
|
||||||
case "node_home_yellow" -> BoardAsset.node_home_yellow;
|
case "node_home_yellow" -> Asset.node_home_yellow;
|
||||||
case "node_home_black" -> BoardAsset.node_home_black;
|
case "node_home_black" -> Asset.node_home_black;
|
||||||
case "node_home_green" -> BoardAsset.node_home_green;
|
case "node_home_green" -> Asset.node_home_green;
|
||||||
case "node_wait_blue" -> BoardAsset.node_wait_blue;
|
case "node_wait_blue" -> Asset.node_wait_blue;
|
||||||
case "node_wait_yellow" -> BoardAsset.node_wait_yellow;
|
case "node_wait_yellow" -> Asset.node_wait_yellow;
|
||||||
case "node_wait_black" -> BoardAsset.node_wait_black;
|
case "node_wait_black" -> Asset.node_wait_black;
|
||||||
case "node_wait_green" -> BoardAsset.node_wait_green;
|
case "node_wait_green" -> Asset.node_wait_green;
|
||||||
case "world" -> BoardAsset.world;
|
case "world" -> Asset.world;
|
||||||
case "jet" -> BoardAsset.jet;
|
case "jet" -> Asset.jet;
|
||||||
case "big_tent" -> BoardAsset.bigTent;
|
case "big_tent" -> Asset.bigTent;
|
||||||
case "small_tent" -> BoardAsset.smallTent;
|
case "small_tent" -> Asset.smallTent;
|
||||||
case "radar" -> BoardAsset.radar;
|
case "radar" -> Asset.radar;
|
||||||
case "ship" -> BoardAsset.ship;
|
case "ship" -> Asset.ship;
|
||||||
case "tank" -> BoardAsset.tank;
|
case "tank" -> Asset.tank;
|
||||||
case "tree_small" -> BoardAsset.tree_small;
|
case "tree_small" -> Asset.tree_small;
|
||||||
case "tree_big" -> BoardAsset.tree_big;
|
case "tree_big" -> Asset.tree_big;
|
||||||
default -> throw new IllegalStateException("Unexpected value: " + assetName);
|
default -> throw new IllegalStateException("Unexpected value: " + assetName);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
import com.jme3.scene.Node;
|
import com.jme3.scene.Node;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.scene.control.AbstractControl;
|
import com.jme3.scene.control.AbstractControl;
|
||||||
|
import pp.mdga.client.Asset;
|
||||||
import pp.mdga.client.MdgaApp;
|
import pp.mdga.client.MdgaApp;
|
||||||
import pp.mdga.client.board.Outline.SelectObjectOutliner;
|
import pp.mdga.client.board.Outline.SelectObjectOutliner;
|
||||||
|
|
||||||
@@ -107,7 +108,7 @@ public void rotateInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void activateShield(){
|
public void activateShield(){
|
||||||
shieldRing = assetManager.loadModel(BoardAsset.shield_ring.getModelPath());
|
shieldRing = assetManager.loadModel(Asset.shield_ring.getModelPath());
|
||||||
shieldRing.scale(1f);
|
shieldRing.scale(1f);
|
||||||
shieldRing.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(0));
|
shieldRing.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(0));
|
||||||
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z)));
|
shieldRing.setLocalTranslation(spatial.getLocalTranslation().add(new Vector3f(0,0,SHIELD_Z)));
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package pp.mdga.client.gui;
|
||||||
|
|
||||||
|
import com.jme3.renderer.RenderManager;
|
||||||
|
import com.jme3.renderer.ViewPort;
|
||||||
|
import com.jme3.scene.control.AbstractControl;
|
||||||
|
|
||||||
|
public class CardControl extends AbstractControl {
|
||||||
|
|
||||||
|
public CardControl(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void controlUpdate(float tpf) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void controlRender(RenderManager rm, ViewPort vp) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package pp.mdga.client.gui;
|
||||||
|
|
||||||
|
import com.jme3.app.Application;
|
||||||
|
import com.jme3.app.state.AbstractAppState;
|
||||||
|
import com.jme3.app.state.AppStateManager;
|
||||||
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.renderer.Camera;
|
||||||
|
import com.jme3.renderer.RenderManager;
|
||||||
|
import com.jme3.renderer.ViewPort;
|
||||||
|
import com.jme3.scene.Node;
|
||||||
|
import com.jme3.scene.Spatial;
|
||||||
|
import pp.mdga.client.Asset;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class CardLayer extends AbstractAppState {
|
||||||
|
|
||||||
|
private Node root;
|
||||||
|
private Application app;
|
||||||
|
private boolean init;
|
||||||
|
|
||||||
|
private List<Spatial> cardBuffer;
|
||||||
|
|
||||||
|
|
||||||
|
public CardLayer() {
|
||||||
|
this.cardBuffer = new ArrayList<>();
|
||||||
|
init = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(AppStateManager stateManager, Application app ) {
|
||||||
|
this.app = app;
|
||||||
|
root = new Node("Under gui viewport Root");
|
||||||
|
|
||||||
|
Camera originalCam = app.getCamera();
|
||||||
|
|
||||||
|
Camera cam = new Camera(originalCam.getWidth(), originalCam.getHeight());
|
||||||
|
cam.setParallelProjection(false);
|
||||||
|
cam.setFrustum(originalCam.getFrustumNear(), originalCam.getFrustumFar(), originalCam.getFrustumLeft(), originalCam.getFrustumRight(),originalCam.getFrustumTop(), originalCam.getFrustumBottom());
|
||||||
|
cam.setFov(originalCam.getFov());
|
||||||
|
cam.setLocation(new Vector3f(0, 0, 10));
|
||||||
|
cam.lookAt(new Vector3f(0,0,0), Vector3f.UNIT_Y);
|
||||||
|
|
||||||
|
ViewPort view = app.getRenderManager().createMainView("Under gui ViewPort", cam);
|
||||||
|
view.setEnabled(true);
|
||||||
|
view.setClearFlags(false, true, false);
|
||||||
|
view.attachScene(root);
|
||||||
|
|
||||||
|
if(!init) init = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(RenderManager rm) {
|
||||||
|
root.updateGeometricState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update( float tpf ) {
|
||||||
|
root.updateLogicalState(tpf);
|
||||||
|
|
||||||
|
if (init && !cardBuffer.isEmpty()) {
|
||||||
|
for(Spatial spatial : cardBuffer){
|
||||||
|
root.attachChild(spatial);
|
||||||
|
}
|
||||||
|
cardBuffer.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCard(Spatial card){
|
||||||
|
cardBuffer.add(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,70 @@
|
|||||||
package pp.mdga.client.gui;
|
package pp.mdga.client.gui;
|
||||||
|
|
||||||
|
import com.jme3.material.Material;
|
||||||
|
import com.jme3.math.Vector3f;
|
||||||
|
import com.jme3.scene.Spatial;
|
||||||
|
import pp.mdga.client.Asset;
|
||||||
|
import pp.mdga.client.MdgaApp;
|
||||||
|
import pp.mdga.game.BonusCard;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public class GuiHandler {
|
public class GuiHandler {
|
||||||
|
|
||||||
|
private MdgaApp app;
|
||||||
|
private CardLayer cardLayer;
|
||||||
|
private Map<UUID, CardControl> ownCardsMap;
|
||||||
|
|
||||||
|
private static final Vector3f START = new Vector3f(-3,-3,0);
|
||||||
|
private static final Vector3f MARGIN = new Vector3f(2.5f,0,0);
|
||||||
|
|
||||||
|
public GuiHandler(MdgaApp app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(){
|
||||||
|
cardLayer = new CardLayer();
|
||||||
|
app.getStateManager().attach(cardLayer);
|
||||||
|
ownCardsMap = new HashMap<>();
|
||||||
|
|
||||||
|
addCard(BonusCard.SHIELD, UUID.randomUUID());
|
||||||
|
addCard(BonusCard.TURBO, UUID.randomUUID());
|
||||||
|
addCard(BonusCard.SWAP, UUID.randomUUID());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private Asset bonusToAsset(BonusCard card){
|
||||||
|
return switch (card){
|
||||||
|
case TURBO -> Asset.turboCard;
|
||||||
|
case SHIELD -> Asset.shieldCard;
|
||||||
|
case SWAP -> Asset.swapCard;
|
||||||
|
case HIDDEN -> throw new RuntimeException("HIDDEN is not allowed in GUI");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCard(BonusCard card, UUID uuid) {
|
||||||
|
CardControl control = createCard(bonusToAsset(card), nextPos());
|
||||||
|
ownCardsMap.put(uuid, control);
|
||||||
|
cardLayer.addCard(control.getSpatial());
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vector3f nextPos() {
|
||||||
|
return START.add(MARGIN.mult(ownCardsMap.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private CardControl createCard(Asset card, Vector3f pos){
|
||||||
|
Spatial spatial = app.getAssetManager().loadModel(card.getModelPath());
|
||||||
|
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
mat.setTexture("ColorMap", app.getAssetManager().loadTexture(card.getDiffPath()));
|
||||||
|
spatial.setMaterial(mat);
|
||||||
|
spatial.setLocalScale(1f);
|
||||||
|
spatial.setLocalTranslation(pos);
|
||||||
|
spatial.rotate((float)Math.toRadians(90), (float)Math.toRadians(180), (float)Math.toRadians(180));
|
||||||
|
CardControl control = new CardControl();
|
||||||
|
spatial.addControl(control);
|
||||||
|
return control;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,17 @@
|
|||||||
import pp.mdga.client.dialog.SingleButtonRightDialog;
|
import pp.mdga.client.dialog.SingleButtonRightDialog;
|
||||||
import pp.mdga.client.MdgaApp;
|
import pp.mdga.client.MdgaApp;
|
||||||
import pp.mdga.client.MdgaState;
|
import pp.mdga.client.MdgaState;
|
||||||
|
import pp.mdga.client.gui.GuiHandler;
|
||||||
|
import pp.mdga.game.Color;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class GameView extends MdgaView {
|
public class GameView extends MdgaView {
|
||||||
private BoardHandler boardHandler;
|
private BoardHandler boardHandler;
|
||||||
private CameraHandler camera;
|
private CameraHandler camera;
|
||||||
|
private GuiHandler guiHandler;
|
||||||
|
|
||||||
private SingleButtonLeftDialog leaveButton;
|
private SingleButtonLeftDialog leaveButton;
|
||||||
private SingleButtonRightDialog continueButton;
|
private SingleButtonRightDialog continueButton;
|
||||||
@@ -24,6 +31,8 @@ public GameView(MdgaApp app) {
|
|||||||
this.boardHandler = new BoardHandler(app, fpp);
|
this.boardHandler = new BoardHandler(app, fpp);
|
||||||
app.getViewPort().addProcessor(fpp);
|
app.getViewPort().addProcessor(fpp);
|
||||||
|
|
||||||
|
this.guiHandler = new GuiHandler(app);
|
||||||
|
|
||||||
leaveButton = new SingleButtonLeftDialog(app, settingsNode, "Verlassen", () -> leaveGame());
|
leaveButton = new SingleButtonLeftDialog(app, settingsNode, "Verlassen", () -> leaveGame());
|
||||||
|
|
||||||
continueButton = new SingleButtonRightDialog(app, node, "Weiter", () -> app.getModelSyncronizer().enter(MdgaState.CEREMONY));
|
continueButton = new SingleButtonRightDialog(app, node, "Weiter", () -> app.getModelSyncronizer().enter(MdgaState.CEREMONY));
|
||||||
@@ -33,8 +42,9 @@ public GameView(MdgaApp app) {
|
|||||||
public void onEnter() {
|
public void onEnter() {
|
||||||
camera.init();
|
camera.init();
|
||||||
boardHandler.init();
|
boardHandler.init();
|
||||||
|
guiHandler.init();
|
||||||
continueButton.show();
|
continueButton.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package pp.mdga.game;
|
package pp.mdga.game;
|
||||||
|
|
||||||
public enum BonusCard {
|
public enum BonusCard {
|
||||||
HIDDERN,
|
HIDDEN,
|
||||||
SHIELD,
|
SHIELD,
|
||||||
TURBO,
|
TURBO,
|
||||||
SWAP
|
SWAP
|
||||||
|
|||||||
Reference in New Issue
Block a user