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 b300a63..352eae4 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 @@ -3,6 +3,9 @@ package pp.monopoly.client; import com.jme3.app.Application; import com.jme3.app.state.AppStateManager; import com.jme3.asset.AssetManager; +import com.jme3.effect.ParticleEmitter; +import com.jme3.effect.ParticleMesh; +import com.jme3.effect.shapes.EmitterSphereShape; import com.jme3.light.AmbientLight; import com.jme3.light.DirectionalLight; import com.jme3.material.Material; @@ -203,10 +206,10 @@ public class BoardAppState extends MonopolyAppState { final float x = board.getWidth(); final float y = board.getHeight(); final Box seaMesh = new Box(y, 0.1f, x); - final Geometry seaGeo = new Geometry("sea", seaMesh); //NONs-NLS + final Geometry seaGeo = new Geometry("sea", seaMesh); //NON-NLS seaGeo.setLocalTranslation(new Vector3f(0, -0.1f, 0)); - Quaternion rotation = new com.jme3.math.Quaternion(); - rotation.fromAngleAxis(FastMath.HALF_PI, com.jme3.math.Vector3f.UNIT_Y); + Quaternion rotation = new Quaternion(); + rotation.fromAngleAxis(FastMath.HALF_PI, Vector3f.UNIT_Y); seaGeo.setLocalRotation(rotation); final Material seaMat = new Material(getApp().getAssetManager(), "Common/MatDefs/Light/Lighting.j3md"); Texture texture = getApp().getAssetManager().loadTexture("Pictures/board2.png"); @@ -214,8 +217,12 @@ public class BoardAppState extends MonopolyAppState { seaGeo.setMaterial(seaMat); seaGeo.setShadowMode(ShadowMode.CastAndReceive); TangentBinormalGenerator.generate(seaGeo); + sceneNode.attachChild(createCardDeck()); sceneNode.attachChild(seaGeo); + + // Schneefall hinzufügen + addSnowEffect(sceneNode); } private Node createCardDeck() { @@ -237,5 +244,34 @@ public class BoardAppState extends MonopolyAppState { public Vector3f getCurrentTarget(){ return currentTarget; -} + } + + private void addSnowEffect(Node parentNode) { + // ParticleEmitter für Schnee + ParticleEmitter snowEmitter = new ParticleEmitter("Snow", ParticleMesh.Type.Triangle, 5000); + Material snowMat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); + snowMat.setTexture("Texture", getApp().getAssetManager().loadTexture("Textures/snowflake.png")); // Schneeflocken-Textur + snowEmitter.setMaterial(snowMat); + + // Eigenschaften für Schneepartikel + snowEmitter.setImagesX(1); + snowEmitter.setImagesY(1); + snowEmitter.setEndColor(new ColorRGBA(1f, 1f, 1f, 0.5f)); // Weiß, halbtransparent + snowEmitter.setStartColor(new ColorRGBA(1f, 1f, 1f, 1f)); // Vollweiß + snowEmitter.setStartSize(0.1f); + snowEmitter.setEndSize(0.2f); + snowEmitter.setGravity(0, 0.5f, 0); // Langsames Fallen + snowEmitter.setLowLife(3f); + snowEmitter.setHighLife(15f); + snowEmitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0, -1, 0)); + snowEmitter.getParticleInfluencer().setVelocityVariation(0.3f); + + // Spawn-Bereich für Schneeflocken definieren + snowEmitter.setParticlesPerSec(200); + snowEmitter.setLocalTranslation(0, 10, 0); + snowEmitter.setShape(new EmitterSphereShape(new Vector3f(0, 0, 0), 15)); // Bereich von -15 bis 15 + + // Emitter zur Szene hinzufügen + parentNode.attachChild(snowEmitter); + } } \ No newline at end of file diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java index ed499d4..26df1ab 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/StartMenu.java @@ -65,7 +65,7 @@ public class StartMenu extends Dialog { app.getGuiNode().attachChild(centerMenu); // Load the Monopoly logo as a texture - Texture logoTexture = app.getAssetManager().loadTexture("Pictures/logo-monopoly.png"); + Texture logoTexture = app.getAssetManager().loadTexture("Pictures/logo-monopolyw.png"); // Create a container for the logo Container logoContainer = new Container(); diff --git a/Projekte/monopoly/client/src/main/resources/Pictures/logo-monopolyw.png b/Projekte/monopoly/client/src/main/resources/Pictures/logo-monopolyw.png new file mode 100644 index 0000000..15a4f6f Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/Pictures/logo-monopolyw.png differ diff --git a/Projekte/monopoly/client/src/main/resources/Textures/snowflake.png b/Projekte/monopoly/client/src/main/resources/Textures/snowflake.png new file mode 100644 index 0000000..056e94c Binary files /dev/null and b/Projekte/monopoly/client/src/main/resources/Textures/snowflake.png differ