diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/BoardAppState.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/BoardAppState.java index 4f1ea7a..38b3b47 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/BoardAppState.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/BoardAppState.java @@ -77,11 +77,11 @@ public class BoardAppState extends MonopolyAppState { */ private PopUpManager popUpManager;; - private Vector3f currentTarget = new Vector3f(-10f,0,-10f); + private Vector3f currentTarget; private float modelHeight = -5f; private final float targetHeight = 0f; - private final float animationSpeed = 0.01389f; + private final float animationSpeed = 0.001389f; private Node modelNode; private boolean startAnimation = false; private CameraController cameraController; @@ -220,22 +220,43 @@ public class BoardAppState extends MonopolyAppState { private Node createCardDeck() { Node cardDeck = new Node("cardDeck"); - Spatial card = getApp().getAssetManager().loadModel("models/Kartendecks/Ereigniskarten.j3o"); - card.setLocalTranslation(5.5f, 0, 2.7f); - card.setLocalScale(4.1f); - card.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.QUARTER_PI, Vector3f.UNIT_Y)); - - Spatial card2 = getApp().getAssetManager().loadModel("models/Kartendecks/Gemeinschaftskarten.j3o"); - card2.setLocalTranslation(-1.4f, 0, -3.8f); - card2.setLocalScale(4.1f); - card2.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.QUARTER_PI , Vector3f.UNIT_Y)); - - //TODO insert card deck - // cardDeck.attachChild(card); - // cardDeck.attachChild(card2); + + // Ereigniskarten + Vector3f basePosition1 = new Vector3f(3.1f, 0.4f, 3.8f); // Basisposition für Ereigniskarten + float baseRotation1 = -60; // Basisrotation in Grad + for (int i = 0; i < 6; i++) { + Box box = new Box(1.2f, 0.05f, 1.8f); // Sehr flaches Rechteck + Geometry flatCard = new Geometry("Ereigniskarten_" + i, box); + Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); + mat.setTexture("ColorMap", getApp().getAssetManager().loadTexture("Textures/Ereigniskarten.png")); + flatCard.setMaterial(mat); + + // Position und Rotation für die Karte + flatCard.setLocalTranslation(basePosition1.x, basePosition1.y - (i * 0.08f), basePosition1.z); + flatCard.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.DEG_TO_RAD * (baseRotation1 - (i * 5)), Vector3f.UNIT_Y)); + + cardDeck.attachChild(flatCard); + } + + // Gemeinschaftskarten + Vector3f basePosition2 = new Vector3f(-3.3f, 0.4f, -3.8f); // Basisposition für Gemeinschaftskarten + float baseRotation2 = -220; // Basisrotation in Grad + for (int i = 0; i < 6; i++) { + Box box = new Box(1.2f, 0.04f, 1.8f); // Sehr flaches Rechteck + Geometry flatCard = new Geometry("Gemeinschaftskarten_" + i, box); + Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md"); + mat.setTexture("ColorMap", getApp().getAssetManager().loadTexture("Textures/Gemeinschaftskarten.png")); + flatCard.setMaterial(mat); + + // Position und Rotation für die Karte + flatCard.setLocalTranslation(basePosition2.x, basePosition2.y - (i * 0.08f), basePosition2.z); + flatCard.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.DEG_TO_RAD * (baseRotation2 - (i * 5)), Vector3f.UNIT_Y)); + + cardDeck.attachChild(flatCard); + } + return cardDeck; } - public Vector3f getCurrentTarget(){ return currentTarget; } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java index d4a085e..bbeba00 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/MonopolyApp.java @@ -293,6 +293,8 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga stateManager.attach(stats); } flyCam.setEnabled(true); + flyCam.setMoveSpeed(4f); // Setzt die Bewegungsgeschwindigkeit der Kamera (Standardwert ist 1f) + stateManager.detach(stateManager.getState(StatsAppState.class)); stateManager.detach(stateManager.getState(DebugKeysAppState.class)); diff --git a/Projekte/monopoly/client/src/main/resources/Textures/Ereigniskarten.png b/Projekte/monopoly/client/src/main/resources/Textures/Ereigniskarten.png new file mode 100644 index 0000000..741cc58 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/Textures/Ereigniskarten.png differ diff --git a/Projekte/monopoly/client/src/main/resources/Textures/Gemeinschaftskarten.png b/Projekte/monopoly/client/src/main/resources/Textures/Gemeinschaftskarten.png new file mode 100644 index 0000000..b81e170 Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/Textures/Gemeinschaftskarten.png differ