Compare commits
22 Commits
b_wilkenin
...
revert-f24
Author | SHA1 | Date | |
---|---|---|---|
|
0f44d37d4a | ||
|
f248a77c81 | ||
|
aa9c073931 | ||
|
1740988629 | ||
|
dcc7cf9c20 | ||
|
5501c0716d | ||
|
8261e1b3b2 | ||
|
5cca8f5c05 | ||
|
133921cfbb | ||
|
4cf14d02ee | ||
|
50bee91775 | ||
|
a656ab5062 | ||
|
b2a6f86fc2 | ||
|
9f90d92198 | ||
|
3e913f636c | ||
|
806c00c94a | ||
|
4fff32c13e | ||
|
1c99117ca0 | ||
|
62421e87cc | ||
|
e343074240 | ||
|
35f154aa0f | ||
|
4488911e82 |
@@ -9,6 +9,7 @@ dependencies {
|
|||||||
implementation project(":battleship:model")
|
implementation project(":battleship:model")
|
||||||
|
|
||||||
implementation libs.jme3.desktop
|
implementation libs.jme3.desktop
|
||||||
|
implementation libs.jme3.effects
|
||||||
|
|
||||||
runtimeOnly libs.jme3.awt.dialogs
|
runtimeOnly libs.jme3.awt.dialogs
|
||||||
runtimeOnly libs.jme3.plugins
|
runtimeOnly libs.jme3.plugins
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
# Specifies the map used by the opponent in single mode.
|
# Specifies the map used by the opponent in single mode.
|
||||||
# Single mode is activated if this property is set.
|
# Single mode is activated if this property is set.
|
||||||
map.opponent=maps/map2.json
|
#map.opponent=maps/map2.json
|
||||||
#
|
#
|
||||||
# Specifies the map used by the player in single mode.
|
# Specifies the map used by the player in single mode.
|
||||||
# The player must define their own map if this property is not set.
|
# The player must define their own map if this property is not set.
|
||||||
|
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 4,
|
|
||||||
"x": 15,
|
|
||||||
"y": 5,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 2,
|
|
||||||
"y": 6,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 4,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 4,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 1,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 4,
|
|
||||||
"x": 0,
|
|
||||||
"y": 5,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 2,
|
|
||||||
"y": 6,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 0,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 4,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 1,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 4,
|
|
||||||
"x": 0,
|
|
||||||
"y": 5,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 6,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 4,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 4,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 1,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 2,
|
|
||||||
"y": 6,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 4,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 4,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 1,
|
|
||||||
"rot": "DOWN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 4,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 4,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 7,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 0,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 2,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 4,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 6,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 7,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 8,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 9,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
"width": 10,
|
|
||||||
"height": 10,
|
|
||||||
"ships": [
|
|
||||||
{
|
|
||||||
"length": 4,
|
|
||||||
"x": 0,
|
|
||||||
"y": 9,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 8,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 3,
|
|
||||||
"x": 0,
|
|
||||||
"y": 7,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 0,
|
|
||||||
"y": 6,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 0,
|
|
||||||
"y": 5,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 2,
|
|
||||||
"x": 0,
|
|
||||||
"y": 4,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 0,
|
|
||||||
"y": 3,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 0,
|
|
||||||
"y": 2,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 0,
|
|
||||||
"y": 1,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"length": 1,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"rot": "RIGHT"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@@ -22,6 +22,7 @@ import com.simsilica.lemur.GuiGlobals;
|
|||||||
import com.simsilica.lemur.style.BaseStyles;
|
import com.simsilica.lemur.style.BaseStyles;
|
||||||
import pp.battleship.client.gui.BattleAppState;
|
import pp.battleship.client.gui.BattleAppState;
|
||||||
import pp.battleship.client.gui.EditorAppState;
|
import pp.battleship.client.gui.EditorAppState;
|
||||||
|
import pp.battleship.client.gui.GameMusic;
|
||||||
import pp.battleship.client.gui.SeaAppState;
|
import pp.battleship.client.gui.SeaAppState;
|
||||||
import pp.battleship.game.client.BattleshipClient;
|
import pp.battleship.game.client.BattleshipClient;
|
||||||
import pp.battleship.game.client.ClientGameLogic;
|
import pp.battleship.game.client.ClientGameLogic;
|
||||||
@@ -282,15 +283,14 @@ public class BattleshipApp extends SimpleApplication implements BattleshipClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attaches the music state and sets its initial enabled state.
|
* Attaches the background music state and sets its initial enabled state.
|
||||||
*/
|
*/
|
||||||
private void attachGameMusic() {
|
private void attachGameMusic() {
|
||||||
final GameMusic gameMusic = new GameMusic();
|
final GameMusic gameSound = new GameMusic();
|
||||||
gameMusic.setEnabled(GameMusic.enabledInPreferences());
|
gameSound.setEnabled(GameMusic.enabledInPreferences());
|
||||||
stateManager.attach(gameMusic);
|
stateManager.attach(gameSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the application state every frame.
|
* Updates the application state every frame.
|
||||||
* This method is called once per frame during the game loop.
|
* This method is called once per frame during the game loop.
|
||||||
|
@@ -34,7 +34,6 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
|||||||
private AudioNode splashSound;
|
private AudioNode splashSound;
|
||||||
private AudioNode shipDestroyedSound;
|
private AudioNode shipDestroyedSound;
|
||||||
private AudioNode explosionSound;
|
private AudioNode explosionSound;
|
||||||
private AudioNode shellFlyingSound;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if sound is enabled in the preferences.
|
* Checks if sound is enabled in the preferences.
|
||||||
@@ -79,8 +78,6 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
|||||||
shipDestroyedSound = loadSound(app, "Sound/Effects/sunken.wav"); //NON-NLS
|
shipDestroyedSound = loadSound(app, "Sound/Effects/sunken.wav"); //NON-NLS
|
||||||
splashSound = loadSound(app, "Sound/Effects/splash.wav"); //NON-NLS
|
splashSound = loadSound(app, "Sound/Effects/splash.wav"); //NON-NLS
|
||||||
explosionSound = loadSound(app, "Sound/Effects/explosion.wav"); //NON-NLS
|
explosionSound = loadSound(app, "Sound/Effects/explosion.wav"); //NON-NLS
|
||||||
shellFlyingSound = loadSound(app, "Sound/Effects/shell_flying.wav");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,28 +124,12 @@ public class GameSound extends AbstractAppState implements GameEventListener {
|
|||||||
shipDestroyedSound.playInstance();
|
shipDestroyedSound.playInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Plays the shell flying sound effect.
|
|
||||||
*/
|
|
||||||
public void shellFly() {
|
|
||||||
if (isEnabled() && shellFlyingSound != null) {
|
|
||||||
shellFlyingSound.playInstance();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handles a recieved {@code SoundEvent} and plays the according sound.
|
|
||||||
*
|
|
||||||
* @param event the Sound event to be processed
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public void receivedEvent(SoundEvent event) {
|
public void receivedEvent(SoundEvent event) {
|
||||||
switch (event.sound()) {
|
switch (event.sound()) {
|
||||||
case EXPLOSION -> explosion();
|
case EXPLOSION -> explosion();
|
||||||
case SPLASH -> splash();
|
case SPLASH -> splash();
|
||||||
case DESTROYED_SHIP -> shipDestroyed();
|
case DESTROYED_SHIP -> shipDestroyed();
|
||||||
case SHELL_FLYING -> shellFly();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,13 +11,13 @@ import com.simsilica.lemur.Button;
|
|||||||
import com.simsilica.lemur.Checkbox;
|
import com.simsilica.lemur.Checkbox;
|
||||||
import com.simsilica.lemur.Label;
|
import com.simsilica.lemur.Label;
|
||||||
import com.simsilica.lemur.style.ElementId;
|
import com.simsilica.lemur.style.ElementId;
|
||||||
|
|
||||||
|
import pp.battleship.client.gui.GameMusic;
|
||||||
|
import pp.battleship.client.gui.VolumeSlider;
|
||||||
import pp.dialog.Dialog;
|
import pp.dialog.Dialog;
|
||||||
import pp.dialog.StateCheckboxModel;
|
import pp.dialog.StateCheckboxModel;
|
||||||
import pp.dialog.TextInputDialog;
|
import pp.dialog.TextInputDialog;
|
||||||
|
|
||||||
import pp.battleship.client.GameMusic;
|
|
||||||
import pp.battleship.client.VolumeSlider;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
@@ -51,17 +51,14 @@ class Menu extends Dialog {
|
|||||||
addChild(new Checkbox(lookup("menu.sound-enabled"), new StateCheckboxModel(app, GameSound.class)));
|
addChild(new Checkbox(lookup("menu.sound-enabled"), new StateCheckboxModel(app, GameSound.class)));
|
||||||
|
|
||||||
addChild(new Checkbox(lookup("menu.background-sound-enabled"), new StateCheckboxModel(app, GameMusic.class)));
|
addChild(new Checkbox(lookup("menu.background-sound-enabled"), new StateCheckboxModel(app, GameMusic.class)));
|
||||||
|
|
||||||
addChild(slider);
|
addChild(slider);
|
||||||
|
|
||||||
addChild(loadButton)
|
addChild(loadButton).addClickCommands(s -> ifTopDialog(this::loadDialog));
|
||||||
.addClickCommands(s -> ifTopDialog(this::loadDialog));
|
addChild(saveButton).addClickCommands(s -> ifTopDialog(this::saveDialog));
|
||||||
addChild(saveButton)
|
addChild(new Button(lookup("menu.return-to-game"))).addClickCommands(s -> ifTopDialog(this::close));
|
||||||
.addClickCommands(s -> ifTopDialog(this::saveDialog));
|
addChild(new Button(lookup("menu.quit"))).addClickCommands(s -> ifTopDialog(app::closeApp));
|
||||||
addChild(new Button(lookup("menu.return-to-game")))
|
|
||||||
.addClickCommands(s -> ifTopDialog(this::close));
|
|
||||||
addChild(new Button(lookup("menu.quit")))
|
|
||||||
.addClickCommands(s -> ifTopDialog(app::closeApp));
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +71,11 @@ class Menu extends Dialog {
|
|||||||
saveButton.setEnabled(app.getGameLogic().maySaveMap());
|
saveButton.setEnabled(app.getGameLogic().maySaveMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(float delta) {
|
||||||
|
slider.update();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* As an escape action, this method closes the menu if it is the top dialog.
|
* As an escape action, this method closes the menu if it is the top dialog.
|
||||||
*/
|
*/
|
||||||
@@ -149,13 +151,4 @@ class Menu extends Dialog {
|
|||||||
private void saveDialog() {
|
private void saveDialog() {
|
||||||
fileDialog(app.getGameLogic()::saveMap, lookup("menu.map.save"));
|
fileDialog(app.getGameLogic()::saveMap, lookup("menu.map.save"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the position of the volume control slider.
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update(float delta) {
|
|
||||||
slider.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,7 @@ import com.simsilica.lemur.Container;
|
|||||||
import com.simsilica.lemur.Label;
|
import com.simsilica.lemur.Label;
|
||||||
import com.simsilica.lemur.TextField;
|
import com.simsilica.lemur.TextField;
|
||||||
import com.simsilica.lemur.component.SpringGridLayout;
|
import com.simsilica.lemur.component.SpringGridLayout;
|
||||||
|
|
||||||
import pp.battleship.server.BattleshipServer;
|
import pp.battleship.server.BattleshipServer;
|
||||||
import pp.dialog.Dialog;
|
import pp.dialog.Dialog;
|
||||||
import pp.dialog.DialogBuilder;
|
import pp.dialog.DialogBuilder;
|
||||||
@@ -69,7 +70,7 @@ class NetworkDialog extends SimpleDialog {
|
|||||||
.setOkClose(false)
|
.setOkClose(false)
|
||||||
.setNoClose(false)
|
.setNoClose(false)
|
||||||
.build(this);
|
.build(this);
|
||||||
|
|
||||||
//Add the button to start the sever
|
//Add the button to start the sever
|
||||||
addChild(serverButton).addClickCommands(s -> ifTopDialog(this::startServerInThread));
|
addChild(serverButton).addClickCommands(s -> ifTopDialog(this::startServerInThread));
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package pp.battleship.client;
|
package pp.battleship.client.gui;
|
||||||
|
|
||||||
import static pp.util.PreferencesUtils.getPreferences;
|
import static pp.util.PreferencesUtils.getPreferences;
|
||||||
|
|
||||||
@@ -31,10 +31,10 @@ public class GameMusic extends AbstractAppState{
|
|||||||
return PREFERENCES.getBoolean(ENABLED_PREF, true);
|
return PREFERENCES.getBoolean(ENABLED_PREF, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if sound is enabled in the preferences.
|
* Checks if sound is enabled in the preferences.
|
||||||
*
|
*
|
||||||
*
|
* @return float to which the volume is set
|
||||||
*/
|
*/
|
||||||
public static float volumeInPreferences() {
|
public static float volumeInPreferences() {
|
||||||
return PREFERENCES.getFloat(VOLUME_PREF, 0.5f);
|
return PREFERENCES.getFloat(VOLUME_PREF, 0.5f);
|
||||||
@@ -50,7 +50,7 @@ public class GameMusic extends AbstractAppState{
|
|||||||
@Override
|
@Override
|
||||||
public void initialize(AppStateManager stateManager, Application app) {
|
public void initialize(AppStateManager stateManager, Application app) {
|
||||||
super.initialize(stateManager, app);
|
super.initialize(stateManager, app);
|
||||||
music = loadSound(app, "Sound/DasBootMenu.ogg");
|
music = loadSound(app, "Sound/background.ogg");
|
||||||
setVolume(volumeInPreferences());
|
setVolume(volumeInPreferences());
|
||||||
music.setLooping(true);
|
music.setLooping(true);
|
||||||
if (isEnabled() && music != null) {
|
if (isEnabled() && music != null) {
|
||||||
@@ -87,11 +87,15 @@ public class GameMusic extends AbstractAppState{
|
|||||||
@Override
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
if (isEnabled() == enabled) return;
|
if (isEnabled() == enabled) return;
|
||||||
else if(!isEnabled() && enabled) {
|
|
||||||
if (music != null) music.play();
|
if (music != null) {
|
||||||
} else if (isEnabled() && !enabled) {
|
if (enabled) {
|
||||||
if (music != null) music.stop();
|
music.play();
|
||||||
|
} else {
|
||||||
|
music.stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.setEnabled(enabled);
|
super.setEnabled(enabled);
|
||||||
LOGGER.log(Level.INFO, "Sound enabled: {0}", enabled); //NON-NLS
|
LOGGER.log(Level.INFO, "Sound enabled: {0}", enabled); //NON-NLS
|
||||||
PREFERENCES.putBoolean(ENABLED_PREF, enabled);
|
PREFERENCES.putBoolean(ENABLED_PREF, enabled);
|
||||||
@@ -104,8 +108,12 @@ public class GameMusic extends AbstractAppState{
|
|||||||
setEnabled(!isEnabled());
|
setEnabled(!isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the volume of music
|
||||||
|
* @param vol the volume to which the music should be set
|
||||||
|
*/
|
||||||
public void setVolume(float vol){
|
public void setVolume(float vol){
|
||||||
music.setVolume(vol);
|
music.setVolume(vol);
|
||||||
PREFERENCES.putFloat(VOLUME_PREF, vol);
|
PREFERENCES.putFloat(VOLUME_PREF, vol);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -28,7 +28,7 @@ import pp.util.Position;
|
|||||||
* and interaction between the model and the view.
|
* and interaction between the model and the view.
|
||||||
*/
|
*/
|
||||||
class MapView {
|
class MapView {
|
||||||
public static final float FIELD_SIZE = 40f;
|
private static final float FIELD_SIZE = 40f;
|
||||||
private static final float GRID_LINE_WIDTH = 2f;
|
private static final float GRID_LINE_WIDTH = 2f;
|
||||||
private static final float BACKGROUND_DEPTH = -4f;
|
private static final float BACKGROUND_DEPTH = -4f;
|
||||||
private static final float GRID_DEPTH = -1f;
|
private static final float GRID_DEPTH = -1f;
|
||||||
|
@@ -7,20 +7,13 @@
|
|||||||
|
|
||||||
package pp.battleship.client.gui;
|
package pp.battleship.client.gui;
|
||||||
|
|
||||||
import com.jme3.material.Material;
|
|
||||||
import com.jme3.material.RenderState;
|
|
||||||
import com.jme3.material.RenderState.BlendMode;
|
|
||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.Node;
|
import com.jme3.scene.Node;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.scene.shape.Sphere;
|
|
||||||
import pp.battleship.model.Battleship;
|
import pp.battleship.model.Battleship;
|
||||||
import pp.battleship.model.Shell;
|
|
||||||
import pp.battleship.model.Shot;
|
import pp.battleship.model.Shot;
|
||||||
import pp.util.Position;
|
import pp.util.Position;
|
||||||
import static com.jme3.material.Materials.UNSHADED;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Synchronizes the visual representation of the ship map with the game model.
|
* Synchronizes the visual representation of the ship map with the game model.
|
||||||
@@ -129,25 +122,4 @@ class MapViewSynchronizer extends ShipMapSynchronizer {
|
|||||||
private Geometry shipLine(float x1, float y1, float x2, float y2, ColorRGBA color) {
|
private Geometry shipLine(float x1, float y1, float x2, float y2, ColorRGBA color) {
|
||||||
return view.getApp().getDraw().makeFatLine(x1, y1, x2, y2, SHIP_DEPTH, color, SHIP_LINE_WIDTH);
|
return view.getApp().getDraw().makeFatLine(x1, y1, x2, y2, SHIP_DEPTH, color, SHIP_LINE_WIDTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates and returns a Spatial representation of the given {@code Shell} object
|
|
||||||
* for 2D visualization in the game. The shell is represented as a circle.
|
|
||||||
*
|
|
||||||
* @param shell The {@code Shell} object to be visualized.
|
|
||||||
* @return A {@code Spatial} object representing the shell on the map.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Spatial visit(Shell shell) {
|
|
||||||
final ColorRGBA color = ColorRGBA.Black;
|
|
||||||
Geometry ellipse = new Geometry("ellipse", new Sphere(50, 50, MapView.FIELD_SIZE / 2 * 0.8f));
|
|
||||||
Material mat = new Material(view.getApp().getAssetManager(), UNSHADED); //NON-NLS
|
|
||||||
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
|
|
||||||
mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);
|
|
||||||
mat.setColor("Color", color);
|
|
||||||
ellipse.setMaterial(mat);
|
|
||||||
ellipse.addControl(new Shell2DControl(view, shell));
|
|
||||||
return ellipse;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -7,28 +7,30 @@ import com.jme3.material.Material;
|
|||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.math.FastMath;
|
import com.jme3.math.FastMath;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
|
|
||||||
import pp.battleship.client.BattleshipApp;
|
import pp.battleship.client.BattleshipApp;
|
||||||
|
|
||||||
public class ParticleCreator {
|
/**
|
||||||
|
* Factory class responsible for creating particle effects used in the game.
|
||||||
|
* This centralizes the creation of various types of particle emitters.
|
||||||
|
*/
|
||||||
|
public class ParticleEffectFactory {
|
||||||
private static final int COUNT_FACTOR = 1;
|
private static final int COUNT_FACTOR = 1;
|
||||||
private static final float COUNT_FACTOR_F = 1f;
|
private static final float COUNT_FACTOR_F = 1f;
|
||||||
private static final boolean POINT_SPRITE = true;
|
private static final boolean POINT_SPRITE = true;
|
||||||
private static final Type EMITTER_TYPE = POINT_SPRITE ? Type.Point : Type.Triangle;
|
private static final Type EMITTER_TYPE = POINT_SPRITE ? Type.Point : Type.Triangle;
|
||||||
|
|
||||||
private final BattleshipApp app;
|
private final BattleshipApp app;
|
||||||
|
|
||||||
ParticleCreator(BattleshipApp app) {
|
ParticleEffectFactory(BattleshipApp app) {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a flame particle emitter.
|
* Creates a flame particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured flame particle emitter
|
* @return a configured flame particle emitter
|
||||||
*/
|
*/
|
||||||
|
ParticleEmitter createFlame() {
|
||||||
ParticleEmitter createFlame(){
|
|
||||||
ParticleEmitter flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
|
ParticleEmitter flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR);
|
||||||
flame.setSelectRandomImage(true);
|
flame.setSelectRandomImage(true);
|
||||||
flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F)));
|
flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F)));
|
||||||
@@ -54,7 +56,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a flash particle emitter.
|
* Creates a flash particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured flash particle emitter
|
* @return a configured flash particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createFlash() {
|
ParticleEmitter createFlash() {
|
||||||
@@ -83,7 +85,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a round spark particle emitter.
|
* Creates a round spark particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured round spark particle emitter
|
* @return a configured round spark particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createRoundSpark() {
|
ParticleEmitter createRoundSpark() {
|
||||||
@@ -111,7 +113,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a spark particle emitter.
|
* Creates a spark particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured spark particle emitter
|
* @return a configured spark particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createSpark() {
|
ParticleEmitter createSpark() {
|
||||||
@@ -123,9 +125,9 @@ public class ParticleCreator {
|
|||||||
spark.setFacingVelocity(true);
|
spark.setFacingVelocity(true);
|
||||||
spark.setParticlesPerSec(0);
|
spark.setParticlesPerSec(0);
|
||||||
spark.setGravity(0, 5, 0);
|
spark.setGravity(0, 5, 0);
|
||||||
spark.setLowLife(0.5f);
|
spark.setLowLife(1.1f);
|
||||||
spark.setHighLife(1.5f);
|
spark.setHighLife(1.5f);
|
||||||
spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 8, 0)); // y20
|
spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0));
|
||||||
spark.getParticleInfluencer().setVelocityVariation(1);
|
spark.getParticleInfluencer().setVelocityVariation(1);
|
||||||
spark.setImagesX(1);
|
spark.setImagesX(1);
|
||||||
spark.setImagesY(1);
|
spark.setImagesY(1);
|
||||||
@@ -138,7 +140,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a smoke trail particle emitter.
|
* Creates a smoke trail particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured smoke trail particle emitter
|
* @return a configured smoke trail particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createSmokeTrail() {
|
ParticleEmitter createSmokeTrail() {
|
||||||
@@ -165,7 +167,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a debris particle emitter.
|
* Creates a debris particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured debris particle emitter
|
* @return a configured debris particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createDebris() {
|
ParticleEmitter createDebris() {
|
||||||
@@ -194,7 +196,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a shockwave particle emitter.
|
* Creates a shockwave particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured shockwave particle emitter
|
* @return a configured shockwave particle emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createShockwave() {
|
ParticleEmitter createShockwave() {
|
||||||
@@ -221,7 +223,7 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a moving smoke emitter.
|
* Creates a moving smoke emitter.
|
||||||
*
|
*
|
||||||
* @return a configured smoke emitter
|
* @return a configured smoke emitter
|
||||||
*/
|
*/
|
||||||
ParticleEmitter createMovingSmokeEmitter() {
|
ParticleEmitter createMovingSmokeEmitter() {
|
||||||
@@ -241,20 +243,20 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a one-time water splash particle emitter.
|
* Creates a one-time water splash particle emitter.
|
||||||
*
|
*
|
||||||
* @return a configured one-time water splash particle emitter
|
* @return a configured one-time water splash particle emitter
|
||||||
*/
|
*/
|
||||||
public ParticleEmitter createWaterSplash() {
|
public ParticleEmitter createWaterSplash() {
|
||||||
// Create a new particle emitter for the splash effect
|
// Create a new particle emitter for the splash effect
|
||||||
ParticleEmitter waterSplash = new ParticleEmitter("WaterSplash", Type.Triangle, 30);
|
ParticleEmitter waterSplash = new ParticleEmitter("WaterSplash", Type.Triangle, 30);
|
||||||
|
|
||||||
// Set the shape of the emitter, making particles emit from a point or small area
|
// Set the shape of the emitter, making particles emit from a point or small area
|
||||||
waterSplash.setShape(new EmitterSphereShape(Vector3f.ZERO, 0.2f));
|
waterSplash.setShape(new EmitterSphereShape(Vector3f.ZERO, 0.2f));
|
||||||
|
|
||||||
// Start and end colors for water (blue, fading out)
|
// Start and end colors for water (blue, fading out)
|
||||||
waterSplash.setStartColor(new ColorRGBA(0.4f, 0.4f, 1f, 1f)); // Light blue at start
|
waterSplash.setStartColor(new ColorRGBA(0.4f, 0.4f, 1f, 1f)); // Light blue at start
|
||||||
waterSplash.setEndColor(new ColorRGBA(0.4f, 0.4f, 1f, 0f)); // Transparent at the end
|
waterSplash.setEndColor(new ColorRGBA(0.4f, 0.4f, 1f, 0f)); // Transparent at the end
|
||||||
|
|
||||||
// Particle size: small at start, larger before fading out
|
// Particle size: small at start, larger before fading out
|
||||||
waterSplash.setStartSize(0.1f);
|
waterSplash.setStartSize(0.1f);
|
||||||
waterSplash.setEndSize(0.3f);
|
waterSplash.setEndSize(0.3f);
|
||||||
@@ -265,14 +267,14 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
// Gravity: Pull the water particles downwards
|
// Gravity: Pull the water particles downwards
|
||||||
waterSplash.setGravity(0, -9.81f, 0); // Earth's gravity simulation
|
waterSplash.setGravity(0, -9.81f, 0); // Earth's gravity simulation
|
||||||
|
|
||||||
// Velocity: Give particles an initial burst upward (simulates splash)
|
// Velocity: Give particles an initial burst upward (simulates splash)
|
||||||
waterSplash.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 3, 0));
|
waterSplash.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 3, 0));
|
||||||
waterSplash.getParticleInfluencer().setVelocityVariation(0.6f); // Add randomness to splash
|
waterSplash.getParticleInfluencer().setVelocityVariation(0.6f); // Add randomness to splash
|
||||||
|
|
||||||
// Set how many particles are emitted per second (0 to emit all particles at once)
|
// Set how many particles are emitted per second (0 to emit all particles at once)
|
||||||
waterSplash.setParticlesPerSec(0);
|
waterSplash.setParticlesPerSec(0);
|
||||||
|
|
||||||
// Load a texture for the water splash (assuming a texture exists at this path)
|
// Load a texture for the water splash (assuming a texture exists at this path)
|
||||||
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
|
Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md");
|
||||||
mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Splash/splash.png"));
|
mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Splash/splash.png"));
|
||||||
@@ -280,5 +282,4 @@ public class ParticleCreator {
|
|||||||
|
|
||||||
return waterSplash;
|
return waterSplash;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -20,7 +20,6 @@ import com.jme3.scene.shape.Cylinder;
|
|||||||
import pp.battleship.client.BattleshipApp;
|
import pp.battleship.client.BattleshipApp;
|
||||||
import pp.battleship.model.Battleship;
|
import pp.battleship.model.Battleship;
|
||||||
import pp.battleship.model.Rotation;
|
import pp.battleship.model.Rotation;
|
||||||
import pp.battleship.model.Shell;
|
|
||||||
import pp.battleship.model.ShipMap;
|
import pp.battleship.model.ShipMap;
|
||||||
import pp.battleship.model.Shot;
|
import pp.battleship.model.Shot;
|
||||||
|
|
||||||
@@ -37,10 +36,9 @@ import static pp.util.FloatMath.PI;
|
|||||||
class SeaSynchronizer extends ShipMapSynchronizer {
|
class SeaSynchronizer extends ShipMapSynchronizer {
|
||||||
private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS
|
private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS
|
||||||
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
|
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
|
||||||
private static final String SMALL_SHIP_MODEL = "Models/SmallShip/SmallShip.j3o"; //NON-NLS
|
private static final String BOAT_SMALL_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o"; //NON-NLS
|
||||||
private static final String U_BOAT_MODEL = "Models/WWII_ship_German_Type_II_U-boat_v2/WW2Uboat.j3o"; //NON-NLS
|
private static final String CV_MODEL = "Models/CV/CV.j3o"; //NON-NLS
|
||||||
private static final String TUG_BOAT_MODEL = "Models/TugBoat/TugBoat.j3o"; //NON-NLS
|
private static final String BATTLE_MODEL = "Models/Battle/Battle.j3o"; //NON-NLS
|
||||||
private static final String LIGHTING = "Common/MatDefs/Light/Lighting.j3md";
|
|
||||||
private static final String COLOR = "Color"; //NON-NLS
|
private static final String COLOR = "Color"; //NON-NLS
|
||||||
private static final String SHIP = "ship"; //NON-NLS
|
private static final String SHIP = "ship"; //NON-NLS
|
||||||
private static final String SHOT = "shot"; //NON-NLS
|
private static final String SHOT = "shot"; //NON-NLS
|
||||||
@@ -50,8 +48,7 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
|
|
||||||
private final ShipMap map;
|
private final ShipMap map;
|
||||||
private final BattleshipApp app;
|
private final BattleshipApp app;
|
||||||
private final ParticleCreator particlecreator;
|
private final ParticleEffectFactory particleFactory;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a {@code SeaSynchronizer} object with the specified application, root node, and ship map.
|
* Constructs a {@code SeaSynchronizer} object with the specified application, root node, and ship map.
|
||||||
@@ -64,7 +61,7 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
super(app.getGameLogic().getOwnMap(), root);
|
super(app.getGameLogic().getOwnMap(), root);
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.map = map;
|
this.map = map;
|
||||||
this.particlecreator = new ParticleCreator(app);
|
this.particleFactory = new ParticleEffectFactory(app);
|
||||||
addExisting();
|
addExisting();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +88,7 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
Node shotNode = new Node("ShotNode");
|
Node shotNode = new Node("ShotNode");
|
||||||
Geometry shotCylinder = createCylinder(shot);
|
Geometry shotCylinder = createCylinder(shot);
|
||||||
shotNode.attachChild(shotCylinder);
|
shotNode.attachChild(shotCylinder);
|
||||||
ParticleEmitter waterSplash = particlecreator.createWaterSplash();
|
ParticleEmitter waterSplash = particleFactory.createWaterSplash();
|
||||||
waterSplash.setLocalTranslation(shot.getY() + 0.5f, 0f, shot.getX() + 0.5f);
|
waterSplash.setLocalTranslation(shot.getY() + 0.5f, 0f, shot.getX() + 0.5f);
|
||||||
shotNode.attachChild(waterSplash);
|
shotNode.attachChild(waterSplash);
|
||||||
waterSplash.emitAllParticles();
|
waterSplash.emitAllParticles();
|
||||||
@@ -104,46 +101,45 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
* @param ship the ship to be sunk
|
* @param ship the ship to be sunk
|
||||||
*/
|
*/
|
||||||
private void sinkAndRemoveShip(Battleship ship) {
|
private void sinkAndRemoveShip(Battleship ship) {
|
||||||
Battleship dasIstGelebteTeamarbeit = ship;
|
Battleship wilkeningklaunichtmeinencode = ship;
|
||||||
final Node shipNode = (Node) getSpatial(dasIstGelebteTeamarbeit);
|
final Node shipNode = (Node) getSpatial(wilkeningklaunichtmeinencode);
|
||||||
if (shipNode == null) return;
|
if (shipNode == null) return;
|
||||||
|
|
||||||
// Add sinking control to animate the sinking
|
// Add sinking control to animate the sinking
|
||||||
shipNode.addControl(new SinkControl(shipNode));
|
shipNode.addControl(new SinkingControl(shipNode));
|
||||||
|
|
||||||
// Add particle effects
|
// Add particle effects
|
||||||
ParticleEmitter bubbles = particlecreator.createWaterSplash();
|
ParticleEmitter bubbles = particleFactory.createWaterSplash();
|
||||||
bubbles.setLocalTranslation(shipNode.getLocalTranslation());
|
bubbles.setLocalTranslation(shipNode.getLocalTranslation());
|
||||||
shipNode.attachChild(bubbles);
|
shipNode.attachChild(bubbles);
|
||||||
bubbles.emitAllParticles();
|
bubbles.emitAllParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles a hit by attaching its representation to the node that
|
* Handles a hit by attaching its representation to the node that
|
||||||
* contains the ship model as a child so that it moves with the ship.
|
* contains the ship model as a child so that it moves with the ship.
|
||||||
*
|
*
|
||||||
* @param shot a hit
|
* @param shot a hit
|
||||||
* @return always null to prevent the representation from being attached
|
* @return always null to prevent the representation from being attached to the items node as well
|
||||||
* to the items node as well
|
|
||||||
*/
|
*/
|
||||||
private Spatial handleHit(Shot shot) {
|
private Spatial handleHit(Shot shot) {
|
||||||
final Battleship ship = requireNonNull(map.findShipAt(shot), "Missing ship");
|
final Battleship ship = requireNonNull(map.findShipAt(shot), "Missing ship");
|
||||||
final Node shipNode = requireNonNull((Node) getSpatial(ship), "Missing ship node");
|
final Node shipNode = requireNonNull((Node) getSpatial(ship), "Missing ship node");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Create a new node specifically for the hit effects
|
// Create a new node specifically for the hit effects
|
||||||
Node hitEffectNode = new Node("HitEffectNode");
|
Node hitEffectNode = new Node("HitEffectNode");
|
||||||
|
|
||||||
// Create particle effects
|
// Create particle effects
|
||||||
ParticleEmitter flame = particlecreator.createFlame();
|
ParticleEmitter flame = particleFactory.createFlame();
|
||||||
ParticleEmitter flash = particlecreator.createFlash();
|
ParticleEmitter flash = particleFactory.createFlash();
|
||||||
ParticleEmitter spark = particlecreator.createSpark();
|
ParticleEmitter spark = particleFactory.createSpark();
|
||||||
ParticleEmitter roundSpark = particlecreator.createRoundSpark();
|
ParticleEmitter roundSpark = particleFactory.createRoundSpark();
|
||||||
ParticleEmitter smokeTrail = particlecreator.createSmokeTrail();
|
ParticleEmitter smokeTrail = particleFactory.createSmokeTrail();
|
||||||
ParticleEmitter debris = particlecreator.createDebris();
|
ParticleEmitter debris = particleFactory.createDebris();
|
||||||
ParticleEmitter shockwave = particlecreator.createShockwave();
|
ParticleEmitter shockwave = particleFactory.createShockwave();
|
||||||
ParticleEmitter movingSmoke = particlecreator.createMovingSmokeEmitter();
|
ParticleEmitter movingSmoke = particleFactory.createMovingSmokeEmitter();
|
||||||
|
|
||||||
// Attach all effects to the hitEffectNode
|
// Attach all effects to the hitEffectNode
|
||||||
hitEffectNode.attachChild(flame);
|
hitEffectNode.attachChild(flame);
|
||||||
@@ -157,8 +153,8 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
|
|
||||||
// Set the local translation for the hit effect to the point of impact
|
// Set the local translation for the hit effect to the point of impact
|
||||||
hitEffectNode.setLocalTranslation(shot.getY() + 0.5f - shipNode.getLocalTranslation().x,
|
hitEffectNode.setLocalTranslation(shot.getY() + 0.5f - shipNode.getLocalTranslation().x,
|
||||||
0.5f, // Adjust as needed for height above the ship
|
0.5f, // Adjust as needed for height above the ship
|
||||||
shot.getX() + 0.5f - shipNode.getLocalTranslation().z);
|
shot.getX() + 0.5f - shipNode.getLocalTranslation().z);
|
||||||
|
|
||||||
// Attach the hitEffectNode to the shipNode so it moves with the ship
|
// Attach the hitEffectNode to the shipNode so it moves with the ship
|
||||||
shipNode.attachChild(hitEffectNode);
|
shipNode.attachChild(hitEffectNode);
|
||||||
@@ -231,18 +227,12 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
*/
|
*/
|
||||||
private Spatial createShip(Battleship ship) {
|
private Spatial createShip(Battleship ship) {
|
||||||
switch (ship.getLength()) {
|
switch (ship.getLength()) {
|
||||||
case 4:
|
case 4: return createBattleship(ship);
|
||||||
return createBattleship(ship);
|
case 3: return createCV(ship);
|
||||||
case 3:
|
case 2: return createBattle(ship);
|
||||||
return createLargeship(ship);
|
case 1: return createSmallship(ship);
|
||||||
case 2:
|
default: return createBox(ship);
|
||||||
return createMediumship(ship);
|
|
||||||
case 1:
|
|
||||||
return createSmallship(ship);
|
|
||||||
default:
|
|
||||||
return createBox(ship);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -292,13 +282,20 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
|
|
||||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||||
model.scale(1.48f);
|
model.scale(1.48f);
|
||||||
|
// model.scale(0.0007f);
|
||||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a detailed 3D model to represent a small tug boat.
|
||||||
|
*
|
||||||
|
* @param ship the battleship to be represented
|
||||||
|
* @return the spatial representing a small tug boat
|
||||||
|
*/
|
||||||
private Spatial createSmallship(Battleship ship) {
|
private Spatial createSmallship(Battleship ship) {
|
||||||
final Spatial model = app.getAssetManager().loadModel(SMALL_SHIP_MODEL);
|
final Spatial model = app.getAssetManager().loadModel(BOAT_SMALL_MODEL);
|
||||||
|
|
||||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||||
model.scale(0.0005f);
|
model.scale(0.0005f);
|
||||||
@@ -307,21 +304,35 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Spatial createMediumship(Battleship ship) {
|
/**
|
||||||
final Spatial model = app.getAssetManager().loadModel(U_BOAT_MODEL);
|
* Creates a detailed 3D model to represent a "German WWII UBoat".
|
||||||
|
*
|
||||||
|
* @param ship the battleship to be represented
|
||||||
|
* @return the spatial representing the "German WWII UBoat"
|
||||||
|
*/
|
||||||
|
private Spatial createCV(Battleship ship) {
|
||||||
|
final Spatial model = app.getAssetManager().loadModel(CV_MODEL);
|
||||||
|
|
||||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
model.rotate(0f, calculateRotationAngle(ship.getRot()), 0f);
|
||||||
model.scale(0.27f);
|
model.move(0f, 0.25f, 0f);
|
||||||
|
model.scale(0.85f);
|
||||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Spatial createLargeship(Battleship ship) {
|
/**
|
||||||
final Spatial model = app.getAssetManager().loadModel(TUG_BOAT_MODEL);
|
* Creates a detailed 3D model to represent a battleship.
|
||||||
|
*
|
||||||
|
* @param ship the battleship to be represented
|
||||||
|
* @return the spatial representing a battleship
|
||||||
|
*/
|
||||||
|
private Spatial createBattle(Battleship ship) {
|
||||||
|
final Spatial model = app.getAssetManager().loadModel(BATTLE_MODEL);
|
||||||
|
|
||||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||||
model.scale(0.0004f);
|
model.move(0f, -0.06f, 0f);
|
||||||
|
model.scale(0.27f);
|
||||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||||
|
|
||||||
return model;
|
return model;
|
||||||
@@ -341,25 +352,4 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
|||||||
case UP -> PI;
|
case UP -> PI;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Creates and returns a 3D model representation of the given {@code Shell} object
|
|
||||||
* for visualization in the game.
|
|
||||||
*
|
|
||||||
* @param shell The {@code Shell} object to be visualized.
|
|
||||||
* @return A {@code Spatial} object representing the 3D model of the shell.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Spatial visit(Shell shell) {
|
|
||||||
final Spatial model = app.getAssetManager().loadModel("Models/Shell/shell.j3o");
|
|
||||||
model.setLocalScale(.05f);
|
|
||||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
|
||||||
Material mat = new Material(app.getAssetManager(), LIGHTING);
|
|
||||||
mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture("Models/Shell/shell_color.png"));
|
|
||||||
mat.setReceivesShadows(true);
|
|
||||||
model.setMaterial(mat);
|
|
||||||
|
|
||||||
model.addControl(new ShellControl(shell));
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -1,49 +0,0 @@
|
|||||||
package pp.battleship.client.gui;
|
|
||||||
|
|
||||||
import com.jme3.math.Vector3f;
|
|
||||||
import com.jme3.renderer.RenderManager;
|
|
||||||
import com.jme3.renderer.ViewPort;
|
|
||||||
import com.jme3.scene.control.AbstractControl;
|
|
||||||
import pp.battleship.model.Shell;
|
|
||||||
import pp.util.Position;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls the 2D representation of a {@code Shell} in the game, updating its position
|
|
||||||
* based on the shell's current state in the game model. The {@code Shell2DControl} class
|
|
||||||
* is responsible for translating the shell's 3D position to a 2D view position within
|
|
||||||
* the game's map view.
|
|
||||||
*/
|
|
||||||
public class Shell2DControl extends AbstractControl {
|
|
||||||
private final Shell shell;
|
|
||||||
private final MapView view;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code Shell2DControl} to manage the 2D visualization of the given {@code Shell}.
|
|
||||||
*
|
|
||||||
* @param view The {@code MapView} used to get information about the map to display.
|
|
||||||
* @param shell The {@code Shell} being visualized.
|
|
||||||
*/
|
|
||||||
public Shell2DControl(MapView view, Shell shell){
|
|
||||||
this.shell = shell;
|
|
||||||
this.view = view;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the position of the shell's 2D representation based on the shell's current
|
|
||||||
* 3D position in the game model. The position is mapped from model space to view space
|
|
||||||
* coordinates and translated to the appropriate location within the {@code MapView}.
|
|
||||||
*
|
|
||||||
* @param tpf Time per frame, representing the time elapsed since the last frame.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void controlUpdate(float tpf) {
|
|
||||||
Vector3f shellPos = shell.getPosition();
|
|
||||||
Position viewPos = view.modelToView(shellPos.x, shellPos.z);
|
|
||||||
spatial.setLocalTranslation(viewPos.getX() + MapView.FIELD_SIZE / 2, viewPos.getY() + MapView.FIELD_SIZE / 2, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void controlRender(RenderManager rm, ViewPort vp) {
|
|
||||||
// No rendering-specific behavior required for this control
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,50 +0,0 @@
|
|||||||
package pp.battleship.client.gui;
|
|
||||||
|
|
||||||
import com.jme3.math.Vector3f;
|
|
||||||
import com.jme3.renderer.RenderManager;
|
|
||||||
import com.jme3.renderer.ViewPort;
|
|
||||||
import com.jme3.scene.control.AbstractControl;
|
|
||||||
import pp.battleship.model.Shell;
|
|
||||||
|
|
||||||
import static pp.util.FloatMath.PI;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls the 3D representation of a {@code Shell} in the game, updating its position
|
|
||||||
* and rotation based on the shell's current state in the game model. The {@code ShellControl}
|
|
||||||
* class ensures that the spatial associated with the shell is positioned and oriented correctly
|
|
||||||
* within the world.
|
|
||||||
*/
|
|
||||||
public class ShellControl extends AbstractControl {
|
|
||||||
private final Shell shell;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code ShellControl} to manage the 3D visualization of the given {@code Shell}.
|
|
||||||
*
|
|
||||||
* @param shell The {@code Shell} being visualized and controlled.
|
|
||||||
*/
|
|
||||||
public ShellControl(Shell shell){
|
|
||||||
super();
|
|
||||||
this.shell = shell;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the 3D position and rotation of the shell based on its current state.
|
|
||||||
* Converts map coordinates to world coordinates and applies the shell's orientation.
|
|
||||||
*
|
|
||||||
* @param tpf Time per frame, representing the elapsed time since the last update.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected void controlUpdate(float tpf) {
|
|
||||||
Vector3f pos = shell.getPosition();
|
|
||||||
Vector3f fixed = new Vector3f(pos.z + 0.5f, pos.y, pos.x + 0.5f);
|
|
||||||
fixed.setY(pos.y);
|
|
||||||
spatial.setLocalTranslation(fixed);
|
|
||||||
spatial.setLocalRotation(shell.getRotation());
|
|
||||||
spatial.rotate(PI/2,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void controlRender(RenderManager rm, ViewPort vp) {
|
|
||||||
// No rendering-specific behavior required for this control
|
|
||||||
}
|
|
||||||
}
|
|
@@ -10,7 +10,7 @@ import com.jme3.scene.Node;
|
|||||||
* Control that handles the sinking effect for destroyed ships.
|
* Control that handles the sinking effect for destroyed ships.
|
||||||
* It will gradually move the ship downwards and then remove it from the scene.
|
* It will gradually move the ship downwards and then remove it from the scene.
|
||||||
*/
|
*/
|
||||||
class SinkControl extends AbstractControl {
|
class SinkingControl extends AbstractControl {
|
||||||
private static final float SINK_DURATION = 5f; // Duration of the sinking animation
|
private static final float SINK_DURATION = 5f; // Duration of the sinking animation
|
||||||
private static final float SINK_SPEED = 0.1f; // Speed at which the ship sinks
|
private static final float SINK_SPEED = 0.1f; // Speed at which the ship sinks
|
||||||
private float elapsedTime = 0;
|
private float elapsedTime = 0;
|
||||||
@@ -21,13 +21,13 @@ class SinkControl extends AbstractControl {
|
|||||||
* Constructs a {@code SinkingControl} object with the shipNode to be to be sunk
|
* Constructs a {@code SinkingControl} object with the shipNode to be to be sunk
|
||||||
* @param shipNode the node to handeld
|
* @param shipNode the node to handeld
|
||||||
*/
|
*/
|
||||||
public SinkControl(Node shipNode) {
|
public SinkingControl(Node shipNode) {
|
||||||
this.shipNode = shipNode;
|
this.shipNode = shipNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updated the Map to sink the ship
|
* Updated the Map to sink the ship
|
||||||
*
|
*
|
||||||
* @param tpf time per frame
|
* @param tpf time per frame
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -51,4 +51,3 @@ class SinkControl extends AbstractControl {
|
|||||||
// No rendering-related code needed
|
// No rendering-related code needed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@@ -1,13 +1,20 @@
|
|||||||
package pp.battleship.client;
|
package pp.battleship.client.gui;
|
||||||
|
|
||||||
import com.simsilica.lemur.Slider;
|
import com.simsilica.lemur.Slider;
|
||||||
|
/**
|
||||||
|
* The VolumeSlider class represents the Volume Slider in the Menu.
|
||||||
|
* It extends the Slider class and provides functionalities for setting the music volume,
|
||||||
|
* with the help of the Slider in the GUI
|
||||||
|
*/
|
||||||
public class VolumeSlider extends Slider {
|
public class VolumeSlider extends Slider {
|
||||||
|
|
||||||
private final GameMusic music;
|
private final GameMusic music;
|
||||||
|
|
||||||
private double vol;
|
private double vol;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs the Volume Slider for the Menu dialog
|
||||||
|
* @param music the music instance
|
||||||
|
*/
|
||||||
public VolumeSlider(GameMusic music) {
|
public VolumeSlider(GameMusic music) {
|
||||||
super();
|
super();
|
||||||
this.music = music;
|
this.music = music;
|
||||||
@@ -15,10 +22,14 @@ public class VolumeSlider extends Slider {
|
|||||||
getModel().setPercent(vol);
|
getModel().setPercent(vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* when triggered it updates the volume to the value set with the slider
|
||||||
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
if (vol != getModel().getPercent()) {
|
if (vol != getModel().getPercent()) {
|
||||||
vol = getModel().getPercent();
|
vol = getModel().getPercent();
|
||||||
music.setVolume( (float) vol);
|
music.setVolume( (float) vol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
@@ -19,7 +19,6 @@ import pp.battleship.game.server.Player;
|
|||||||
import pp.battleship.game.server.ServerGameLogic;
|
import pp.battleship.game.server.ServerGameLogic;
|
||||||
import pp.battleship.game.server.ServerSender;
|
import pp.battleship.game.server.ServerSender;
|
||||||
import pp.battleship.message.client.ClientMessage;
|
import pp.battleship.message.client.ClientMessage;
|
||||||
import pp.battleship.message.client.AnimationFinishedMessage;
|
|
||||||
import pp.battleship.message.client.MapMessage;
|
import pp.battleship.message.client.MapMessage;
|
||||||
import pp.battleship.message.client.ShootMessage;
|
import pp.battleship.message.client.ShootMessage;
|
||||||
import pp.battleship.message.server.EffectMessage;
|
import pp.battleship.message.server.EffectMessage;
|
||||||
@@ -116,7 +115,6 @@ public class BattleshipServer implements MessageListener<HostedConnection>, Conn
|
|||||||
Serializer.registerClass(MapMessage.class);
|
Serializer.registerClass(MapMessage.class);
|
||||||
Serializer.registerClass(ShootMessage.class);
|
Serializer.registerClass(ShootMessage.class);
|
||||||
Serializer.registerClass(EffectMessage.class);
|
Serializer.registerClass(EffectMessage.class);
|
||||||
Serializer.registerClass(AnimationFinishedMessage.class);
|
|
||||||
Serializer.registerClass(Battleship.class);
|
Serializer.registerClass(Battleship.class);
|
||||||
Serializer.registerClass(IntPoint.class);
|
Serializer.registerClass(IntPoint.class);
|
||||||
Serializer.registerClass(Shot.class);
|
Serializer.registerClass(Shot.class);
|
||||||
@@ -125,7 +123,6 @@ public class BattleshipServer implements MessageListener<HostedConnection>, Conn
|
|||||||
private void registerListeners() {
|
private void registerListeners() {
|
||||||
myServer.addMessageListener(this, MapMessage.class);
|
myServer.addMessageListener(this, MapMessage.class);
|
||||||
myServer.addMessageListener(this, ShootMessage.class);
|
myServer.addMessageListener(this, ShootMessage.class);
|
||||||
myServer.addMessageListener(this, AnimationFinishedMessage.class);
|
|
||||||
myServer.addConnectionListener(this);
|
myServer.addConnectionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,5 +176,4 @@ public class BattleshipServer implements MessageListener<HostedConnection>, Conn
|
|||||||
else
|
else
|
||||||
LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS
|
LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@@ -15,4 +15,3 @@ record ReceivedMessage(ClientMessage message, int from) {
|
|||||||
message.accept(interpreter, from);
|
message.accept(interpreter, from);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 9.3 KiB |
BIN
Projekte/battleship/client/src/main/resources/Models/CV/CV.j3o
Normal file
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 264 KiB |
BIN
Projekte/battleship/client/src/main/resources/Models/CV/_2.png
Normal file
After Width: | Height: | Size: 80 KiB |
BIN
Projekte/battleship/client/src/main/resources/Models/CV/_6.png
Normal file
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 78 B |
After Width: | Height: | Size: 79 B |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 82 KiB |
BIN
Projekte/battleship/client/src/main/resources/Models/CV/prev.png
Normal file
After Width: | Height: | Size: 670 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 47 KiB |
@@ -42,9 +42,10 @@ public class ModelExporter extends SimpleApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS
|
export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS
|
||||||
export("Models/SmallShip/12219_boat_v2_L2.obj", "SmallShip.j3o"); //NON-NLS
|
export("Models/BoatSmall/12219_boat_v2_L2.obj", "BoatSmall.j3o"); //NON-NLS
|
||||||
export("Models/WWII_ship_German_Type_II_U-boat_v2/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "WW2Uboat.j3o"); //NON-NLS
|
export("Models/Battle/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "Battle.j3o"); //NON-NLS
|
||||||
export("Models/TugBoat/12218_tugboat_v1_L2.obj", "TugBoat.j3o"); //NON-NLS
|
export("Models/CV/essex_scb-125_generic.obj", "CV.j3o"); //NON-NLS
|
||||||
|
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 66 KiB |