Add acoustics #2
18
Projekte/.run/MdgaApp.run.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="MdgaApp" type="Application" factoryName="Application" singleton="false"
|
||||
nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="pp.mdga.client.MdgaApp"/>
|
||||
<module name="Projekte.mdga.client.main"/>
|
||||
<option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=logging.properties"/>
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/>
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="pp.mdga.client.*"/>
|
||||
<option name="ENABLED" value="true"/>
|
||||
</pattern>
|
||||
</extension>
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true"/>
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
BIN
Projekte/mdga/client/Screenshot 2024-11-12 184708.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
22
Projekte/mdga/client/build.gradle
Normal file
@@ -0,0 +1,22 @@
|
||||
plugins {
|
||||
id 'buildlogic.jme-application-conventions'
|
||||
}
|
||||
|
||||
description = 'mdga client'
|
||||
|
||||
dependencies {
|
||||
implementation project(":jme-common")
|
||||
implementation project(":mdga:model")
|
||||
|
||||
implementation libs.jme3.desktop
|
||||
|
||||
runtimeOnly libs.jme3.awt.dialogs
|
||||
runtimeOnly libs.jme3.plugins
|
||||
runtimeOnly libs.jme3.jogg
|
||||
runtimeOnly libs.jme3.testdata
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass = 'pp.mdga.client.MdgaApp'
|
||||
applicationName = 'MDGA'
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package pp.mdga.client.Animation;
|
||||
|
||||
abstract class Animation {
|
||||
abstract void play();
|
||||
abstract void stop();
|
||||
abstract boolean isOver();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package pp.mdga.client.Animation;
|
||||
|
||||
import pp.mdga.client.MdgaApp;
|
||||
|
||||
public class AnimationHandler {
|
||||
private MdgaApp app;
|
||||
|
||||
private Animation animation = null;
|
||||
|
||||
public AnimationHandler(MdgaApp app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
public void playAnimation(AnimationType type) {
|
||||
|
||||
}
|
||||
|
||||
public void update() {
|
||||
if(null == animation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(animation.isOver()) {
|
||||
animation = null;
|
||||
|
||||
//trigger next state
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.client.Animation;
|
||||
|
||||
public enum AnimationType {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package pp.mdga.client.Animation;
|
||||
|
||||
class EmptyAnimation extends Animation {
|
||||
@Override
|
||||
void play() {
|
||||
//nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
void stop() {
|
||||
//nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isOver() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
63
Projekte/mdga/client/src/main/java/pp/mdga/client/Asset.java
Normal file
@@ -0,0 +1,63 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public enum Asset {
|
||||
bigTent,
|
||||
cardStack,
|
||||
cir,
|
||||
heer,
|
||||
jet,
|
||||
lw,
|
||||
marine,
|
||||
node_home_blue("./node_home/node_home.j3o", "./node_home/node_home_blue.png"),
|
||||
node_home_black("./node_home/node_home.j3o", "./node_home/node_home_black.png"),
|
||||
node_home_green("./node_home/node_home.j3o", "./node_home/node_home_green.png"),
|
||||
node_home_yellow("./node_home/node_home.j3o", "./node_home/node_home_yellow.png"),
|
||||
node_normal,
|
||||
node_start("./node_normal/node_normal.j3o", "./node_normal/node_normal_start.png"),
|
||||
node_bonus("./node_normal/node_normal.j3o", "./node_normal/node_normal_bonus.png"),
|
||||
radar,
|
||||
shieldCard,
|
||||
ship,
|
||||
smallTent,
|
||||
swapCard,
|
||||
tank,
|
||||
turboCard,
|
||||
world(1.1f);
|
||||
|
||||
private final String modelPath;
|
||||
private final String diffPath;
|
||||
private final float size;
|
||||
|
||||
Asset(){
|
||||
String folderFileName = "./" + name() + "/" + name();
|
||||
this.modelPath = folderFileName + ".j3o";
|
||||
this.diffPath = folderFileName + "_diff.png";
|
||||
this.size = 1f;
|
||||
}
|
||||
|
||||
Asset(String modelPath, String diffPath){
|
||||
this.modelPath = modelPath;
|
||||
this.diffPath = diffPath;
|
||||
this.size = 1f;
|
||||
}
|
||||
|
||||
Asset(float size){
|
||||
String folderFileName = "./" + name() + "/" + name();
|
||||
this.modelPath = folderFileName + ".j3o";
|
||||
this.diffPath = folderFileName + "_diff.png";
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public String getModelPath() {
|
||||
return modelPath;
|
||||
}
|
||||
|
||||
public String getDiffPath() {
|
||||
return diffPath;
|
||||
}
|
||||
|
||||
public float getSize(){
|
||||
return size;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package pp.mdga.client.Board;
|
||||
|
||||
import com.jme3.math.Vector3f;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class BoardView {
|
||||
private static final float GRID_SIZE = 10.0f;
|
||||
private static final float GRID_ELEVATION = 0.0f;
|
||||
private static final int GRID_EXTEND = 5;
|
||||
|
||||
private PileControl drawPile = new PileControl();
|
||||
private PileControl discardPile = new PileControl();
|
||||
|
||||
private ArrayList<NodeControl> infield = new ArrayList<NodeControl>(40);
|
||||
private ArrayList<PieceControl> pieces;
|
||||
|
||||
BoardView(int playerCount) {
|
||||
assert(2 <= playerCount && playerCount <= 4);
|
||||
|
||||
pieces = new ArrayList<PieceControl>(4 * playerCount);
|
||||
}
|
||||
|
||||
private static Vector3f gridToWorld(int x, int y) {
|
||||
assert(-GRID_EXTEND <= x && x <= GRID_EXTEND);
|
||||
assert(-GRID_EXTEND <= y && y < GRID_EXTEND);
|
||||
|
||||
return new Vector3f(GRID_SIZE * x, GRID_ELEVATION, GRID_SIZE * y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Board;
|
||||
|
||||
public class NodeControl {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Board;
|
||||
|
||||
public class PieceControl {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Board;
|
||||
|
||||
public class PileControl {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class Dialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class DialogView {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class MenuDialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class NetworkDialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class SoundDialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class StartDialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Dialog;
|
||||
|
||||
public class VideoDialog {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.Gui;
|
||||
|
||||
public class GuiView {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
import com.jme3.app.SimpleApplication;
|
||||
import com.jme3.renderer.RenderManager;
|
||||
import pp.mdga.client.Animation.AnimationHandler;
|
||||
import com.jme3.light.AmbientLight;
|
||||
import com.jme3.light.DirectionalLight;
|
||||
import com.jme3.material.Material;
|
||||
import com.jme3.math.ColorRGBA;
|
||||
import com.jme3.math.Vector3f;
|
||||
import com.jme3.renderer.RenderManager;
|
||||
import com.jme3.renderer.queue.RenderQueue;
|
||||
import com.jme3.scene.Spatial;
|
||||
import com.jme3.shadow.DirectionalLightShadowRenderer;
|
||||
import com.jme3.system.AppSettings;
|
||||
|
||||
public class MdgaApp extends SimpleApplication {
|
||||
private AnimationHandler animationHandler;
|
||||
|
||||
public static void main(String[] args) {
|
||||
MdgaApp app = new MdgaApp();
|
||||
AppSettings settings = new AppSettings(true);
|
||||
settings.setSamples(128);
|
||||
settings.setCenterWindow(true);
|
||||
settings.setWidth(1300);
|
||||
settings.setHeight(1000);
|
||||
app.setSettings(settings);
|
||||
app.setShowSettings(false);
|
||||
app.start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void simpleInitApp() {
|
||||
animationHandler = new AnimationHandler(this);
|
||||
|
||||
flyCam.setEnabled(true);
|
||||
int zoom = 20;
|
||||
cam.setLocation(new Vector3f(zoom,0,zoom));
|
||||
cam.lookAt(new Vector3f(0,0,0), new Vector3f(0,0,1));
|
||||
|
||||
DirectionalLight sun = new DirectionalLight();
|
||||
sun.setColor(ColorRGBA.White);
|
||||
sun.setDirection(new Vector3f(-1,0,-1));
|
||||
rootNode.addLight(sun);
|
||||
AmbientLight ambient = new AmbientLight();
|
||||
ambient.setColor(new ColorRGBA(0.3f,0.3f,0.3f,1));
|
||||
rootNode.addLight(ambient);
|
||||
|
||||
final int SHADOWMAP_SIZE=1024*8;
|
||||
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 4);
|
||||
dlsr.setLight(sun);
|
||||
viewPort.addProcessor(dlsr);
|
||||
|
||||
createModel(Asset.lw).setLocalTranslation(new Vector3f(0,-10,0));
|
||||
createModel(Asset.cir).setLocalTranslation(new Vector3f(0,-8,0));
|
||||
createModel(Asset.marine).setLocalTranslation(new Vector3f(0,-6,0));
|
||||
createModel(Asset.heer).setLocalTranslation(new Vector3f(0,-4,0));
|
||||
createModel(Asset.node_normal).setLocalTranslation(new Vector3f(0,-2.5f,0));
|
||||
createModel(Asset.node_home_blue).setLocalTranslation(new Vector3f(0,-1,0));
|
||||
createModel(Asset.smallTent).setLocalTranslation(new Vector3f(0,1,0));
|
||||
createModel(Asset.tank).setLocalTranslation(new Vector3f(0,5,0));
|
||||
createModel(Asset.jet).setLocalTranslation(new Vector3f(0,12,0));
|
||||
createModel(Asset.ship).setLocalTranslation(new Vector3f(0,17,0));
|
||||
createModel(Asset.radar).setLocalTranslation(new Vector3f(0,20,0));
|
||||
|
||||
createModel(Asset.world);
|
||||
|
||||
//System.out.println(Asset.node_normal.getModelPath());
|
||||
//System.out.println(Asset.node_normal.getDiffPath());
|
||||
}
|
||||
|
||||
|
||||
private Spatial createModel(Asset asset){
|
||||
String modelName = asset.getModelPath();
|
||||
String texName = asset.getDiffPath();
|
||||
Spatial model = assetManager.loadModel(modelName);
|
||||
model.scale(asset.getSize());
|
||||
model.rotate((float) Math.toRadians(0), 0, (float) Math.toRadians(90));
|
||||
model.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
|
||||
Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
|
||||
mat.setTexture("DiffuseMap", assetManager.loadTexture(texName));
|
||||
model.setMaterial(mat);
|
||||
rootNode.attachChild(model);
|
||||
return model;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void simpleUpdate(float tpf) {
|
||||
//this method will be called every game tick and can be used to make updates
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client;
|
||||
|
||||
public class NotificationSynchronizer {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class CeremonyState {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class GameState {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class LobbyState {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class MdgaState {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class MusicState {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pp.mdga.client.State;
|
||||
|
||||
public class SoundState {
|
||||
|
||||
}
|
||||
BIN
Projekte/mdga/client/src/main/resources/bigTent/bigTent.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/bigTent/bigTent_diff.png
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
Projekte/mdga/client/src/main/resources/cardStack/cardStack.j3o
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
Projekte/mdga/client/src/main/resources/cir/cir.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/cir/cir_diff.png
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
Projekte/mdga/client/src/main/resources/heer/heer.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/heer/heer_diff.png
Normal file
|
After Width: | Height: | Size: 1.5 MiB |
BIN
Projekte/mdga/client/src/main/resources/jet/jet.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/jet/jet_diff.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Projekte/mdga/client/src/main/resources/lw/lw.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/lw/lw_diff.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
Projekte/mdga/client/src/main/resources/marine/marine.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/marine/marine_diff.png
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
Projekte/mdga/client/src/main/resources/node_home/node_home.j3o
Normal file
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 292 KiB |
|
After Width: | Height: | Size: 291 KiB |
|
After Width: | Height: | Size: 292 KiB |
BIN
Projekte/mdga/client/src/main/resources/radar/radar.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/radar/radar_diff.png
Normal file
|
After Width: | Height: | Size: 298 KiB |
|
After Width: | Height: | Size: 39 KiB |
BIN
Projekte/mdga/client/src/main/resources/ship/ship.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/ship/ship_diff.png
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
Projekte/mdga/client/src/main/resources/smallTent/smallTent.j3o
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
Projekte/mdga/client/src/main/resources/swapCard/swapCard.j3o
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
Projekte/mdga/client/src/main/resources/tank/tank.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/tank/tank_diff.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
Projekte/mdga/client/src/main/resources/turboCard/turboCard.j3o
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Projekte/mdga/client/src/main/resources/world/world.j3o
Normal file
BIN
Projekte/mdga/client/src/main/resources/world/world_diff.png
Normal file
|
After Width: | Height: | Size: 12 MiB |
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class ActivePlayerNotification extends Notification {
|
||||
ActivePlayerNotification(Color color) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Card;
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class DrawCardNotification extends Notification {
|
||||
DrawCardNotification(Color color, Card card) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class InterruptNotification extends Notification {
|
||||
InterruptNotification(Color color) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class MovePieceNotification extends Notification {
|
||||
MovePieceNotification(Color color, int nodeIndex) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
public abstract class Notification {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class PieceInGameNotification extends Notification{
|
||||
PieceInGameNotification(Color color, UUID id) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Card;
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class PlayCardNotification extends Notification {
|
||||
PlayCardNotification(Color color, Card card) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class PlayerInGameNotification extends Notification {
|
||||
PlayerInGameNotification(Color color, String name) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class ResumeNotification extends Notification {
|
||||
ResumeNotification(Color color) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import pp.mdga.game.Color;
|
||||
|
||||
public class RollDiceNotification extends Notification{
|
||||
RollDiceNotification(Color color, int eyes, int moveNumber) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package pp.mdga.notification;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class SwapPieceNotification extends Notification {
|
||||
SwapPieceNotification(UUID a, UUID b) {
|
||||
assert(!a.equals(b));
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
libs {
|
||||
version('jme', '3.6.1-stable')
|
||||
version('jme', '3.7.0-stable')
|
||||
|
||||
library('jme3-core', 'org.jmonkeyengine', 'jme3-core').versionRef('jme')
|
||||
library('jme3-desktop', 'org.jmonkeyengine', 'jme3-desktop').versionRef('jme')
|
||||
@@ -32,3 +32,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
include 'mdga:client'
|
||||
findProject(':mdga:client')?.name = 'client'
|
||||
include 'mdga:client'
|
||||
findProject(':mdga:client')?.name = 'client'
|
||||
|
||||
|
||||