Add DEBUG_MULTIPLIER
This commit is contained in:
@@ -66,7 +66,7 @@ public class MdgaApp extends SimpleApplication {
|
|||||||
|
|
||||||
private ServerConnection networkConnection;
|
private ServerConnection networkConnection;
|
||||||
|
|
||||||
public static final int DEBUG_MULTIPLIER = 0;
|
public static final int DEBUG_MULTIPLIER = 1;
|
||||||
|
|
||||||
public MdgaApp() {
|
public MdgaApp() {
|
||||||
networkConnection = new NetworkSupport(this);
|
networkConnection = new NetworkSupport(this);
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public void confirm() {
|
|||||||
|
|
||||||
GameView gameView = (GameView) app.getView();
|
GameView gameView = (GameView) app.getView();
|
||||||
|
|
||||||
|
gameView.getGuiHandler().hideText();
|
||||||
|
|
||||||
if(a != null && b != null) {
|
if(a != null && b != null) {
|
||||||
app.getGameLogic().selectPiece(a);
|
app.getGameLogic().selectPiece(a);
|
||||||
app.getGameLogic().selectPiece(b);
|
app.getGameLogic().selectPiece(b);
|
||||||
|
|||||||
@@ -69,10 +69,12 @@ public void update() {
|
|||||||
throw new RuntimeException("no notification expected: " + n.getClass().getName());
|
throw new RuntimeException("no notification expected: " + n.getClass().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(0 == MdgaApp.DEBUG_MULTIPLIER) {
|
||||||
delay = 0;
|
delay = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void handleMain(Notification notification) {
|
private void handleMain(Notification notification) {
|
||||||
if (notification instanceof LobbyDialogNotification) {
|
if (notification instanceof LobbyDialogNotification) {
|
||||||
@@ -151,6 +153,7 @@ private void handleGame(Notification notification) {
|
|||||||
guiHandler.showDice();
|
guiHandler.showDice();
|
||||||
} else if (notification instanceof DrawCardNotification n) {
|
} else if (notification instanceof DrawCardNotification n) {
|
||||||
guiHandler.drawCard(n.getColor());
|
guiHandler.drawCard(n.getColor());
|
||||||
|
delay = STANDARD_DELAY;
|
||||||
} else if (notification instanceof HomeMoveNotification home) {
|
} else if (notification instanceof HomeMoveNotification home) {
|
||||||
boardHandler.movePieceHomeAnim(home.getPieceId(), home.getHomeIndex());
|
boardHandler.movePieceHomeAnim(home.getPieceId(), home.getHomeIndex());
|
||||||
guiHandler.hideText();
|
guiHandler.hideText();
|
||||||
@@ -188,13 +191,13 @@ private void handleGame(Notification notification) {
|
|||||||
gameView.getGuiHandler().hideText();
|
gameView.getGuiHandler().hideText();
|
||||||
if(n.getColor() == ownColor){
|
if(n.getColor() == ownColor){
|
||||||
guiHandler.rollDice(n.getEyes(), n.isTurbo() ? n.getMultiplier() : -1);
|
guiHandler.rollDice(n.getEyes(), n.isTurbo() ? n.getMultiplier() : -1);
|
||||||
|
waitForAnimation = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
boardHandler.hideDice();
|
boardHandler.hideDice();
|
||||||
if (n.isTurbo()) guiHandler.showRolledDiceMult(n.getEyes(), n.getMultiplier(), n.getColor());
|
if (n.isTurbo()) guiHandler.showRolledDiceMult(n.getEyes(), n.getMultiplier(), n.getColor());
|
||||||
else guiHandler.showRolledDice(n.getEyes(), n.getColor());
|
else guiHandler.showRolledDice(n.getEyes(), n.getColor());
|
||||||
}
|
}
|
||||||
delay = 7;
|
|
||||||
} else if (notification instanceof SelectableCardsNotification n) {
|
} else if (notification instanceof SelectableCardsNotification n) {
|
||||||
guiHandler.setSelectableCards(n.getCards());
|
guiHandler.setSelectableCards(n.getCards());
|
||||||
gameView.showNoPower();
|
gameView.showNoPower();
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
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.Asset;
|
||||||
|
import pp.mdga.client.MdgaApp;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -51,8 +52,7 @@ protected void controlUpdate(float tpf) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Stop rolling when angular velocity is close to zero
|
// Stop rolling when angular velocity is close to zero
|
||||||
// if (angularVelocity.lengthSquared() < 3f) {
|
if (angularVelocity.lengthSquared() <= 3f || MdgaApp.DEBUG_MULTIPLIER == 0) {
|
||||||
if(true){
|
|
||||||
slerp = true;
|
slerp = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -66,8 +66,7 @@ protected void controlUpdate(float tpf) {
|
|||||||
spatial.setLocalRotation(interpolated);
|
spatial.setLocalRotation(interpolated);
|
||||||
|
|
||||||
// Stop rolling once duration is complete
|
// Stop rolling once duration is complete
|
||||||
// if (timeElapsed >= 1.0f) {
|
if (timeElapsed >= 1.0f * MdgaApp.DEBUG_MULTIPLIER) {
|
||||||
if(true){
|
|
||||||
isRolling = false;
|
isRolling = false;
|
||||||
slerp = false;
|
slerp = false;
|
||||||
actionAfter.run();
|
actionAfter.run();
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public void rollDice(int rollNum, int mult) {
|
|||||||
else actionTextHandler.ownDiceMult(rollNum, mult);
|
else actionTextHandler.ownDiceMult(rollNum, mult);
|
||||||
hideDice();
|
hideDice();
|
||||||
app.getModelSynchronize().animationEnd();
|
app.getModelSynchronize().animationEnd();
|
||||||
|
app.getModelSynchronize().animationEnd();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user