|
|
@ -111,11 +111,22 @@ public class GameScreen extends WizardScreen {
|
|
|
|
dimBehind.setColor(0, 0, 0, 0.5f);
|
|
|
|
dimBehind.setColor(0, 0, 0, 0.5f);
|
|
|
|
dimBehind.setVisible(false);
|
|
|
|
dimBehind.setVisible(false);
|
|
|
|
dimBehind.setTouchable(Touchable.enabled);
|
|
|
|
dimBehind.setTouchable(Touchable.enabled);
|
|
|
|
|
|
|
|
dimBehind.setName("dim_behind");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentRoot = new Group();
|
|
|
|
|
|
|
|
contentRoot.setName("content_root");
|
|
|
|
|
|
|
|
var contentRootWrapper = new Container<>(contentRoot);
|
|
|
|
|
|
|
|
contentRootWrapper.setSize(WizardGame.WIDTH, WizardGame.HEIGHT);
|
|
|
|
|
|
|
|
contentRootWrapper.fill().clip();
|
|
|
|
|
|
|
|
contentRootWrapper.setName("content_root_wrapper");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overlayRoot = new Group();
|
|
|
|
|
|
|
|
overlayRoot.setName("overlay_root");
|
|
|
|
|
|
|
|
|
|
|
|
stage.addActor(dimBehind);
|
|
|
|
stage.addActor(dimBehind);
|
|
|
|
stage.addActor(createBackground());
|
|
|
|
stage.addActor(createBackground());
|
|
|
|
stage.addActor(contentRoot = new Group());
|
|
|
|
stage.addActor(contentRootWrapper);
|
|
|
|
stage.addActor(overlayRoot = new Group());
|
|
|
|
stage.addActor(overlayRoot);
|
|
|
|
stage.addActor(menu = createMenu());
|
|
|
|
stage.addActor(menu = createMenu());
|
|
|
|
|
|
|
|
|
|
|
|
labelStyleDefault = skin.get(Label.LabelStyle.class);
|
|
|
|
labelStyleDefault = skin.get(Label.LabelStyle.class);
|
|
|
@ -135,6 +146,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
messageStack.setPosition(360, 85 + CardActor.PREF_HEIGHT);
|
|
|
|
messageStack.setPosition(360, 85 + CardActor.PREF_HEIGHT);
|
|
|
|
messageStack.setSize(1200, 0);
|
|
|
|
messageStack.setSize(1200, 0);
|
|
|
|
messageStack.setTouchable(Touchable.disabled);
|
|
|
|
messageStack.setTouchable(Touchable.disabled);
|
|
|
|
|
|
|
|
messageStack.setName("message_stack");
|
|
|
|
|
|
|
|
|
|
|
|
padOfTruth = new PadOfTruth(skin, new TextureRegionDrawable(atlas.findRegion(GameAtlas.PAD_OF_TRUTH)));
|
|
|
|
padOfTruth = new PadOfTruth(skin, new TextureRegionDrawable(atlas.findRegion(GameAtlas.PAD_OF_TRUTH)));
|
|
|
|
padOfTruth.setPosition(PAD_OF_TRUTH_POSITION.x, PAD_OF_TRUTH_POSITION.y);
|
|
|
|
padOfTruth.setPosition(PAD_OF_TRUTH_POSITION.x, PAD_OF_TRUTH_POSITION.y);
|
|
|
@ -193,6 +205,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
(WizardGame.HEIGHT - title.getHeight()) / 2
|
|
|
|
(WizardGame.HEIGHT - title.getHeight()) / 2
|
|
|
|
);
|
|
|
|
);
|
|
|
|
group.addActor(title);
|
|
|
|
group.addActor(title);
|
|
|
|
|
|
|
|
group.setName("background");
|
|
|
|
|
|
|
|
|
|
|
|
return group;
|
|
|
|
return group;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -264,6 +277,7 @@ public class GameScreen extends WizardScreen {
|
|
|
|
menu.add(returnToMenu).row();
|
|
|
|
menu.add(returnToMenu).row();
|
|
|
|
|
|
|
|
|
|
|
|
menu.setVisible(false);
|
|
|
|
menu.setVisible(false);
|
|
|
|
|
|
|
|
menu.setName("menu");
|
|
|
|
return menu;
|
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -398,15 +412,20 @@ public class GameScreen extends WizardScreen {
|
|
|
|
public void finishTrick(@NotNull UUID player) {
|
|
|
|
public void finishTrick(@NotNull UUID player) {
|
|
|
|
var seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
|
var seat = seats.getOrDefault(player, Seat.FALLBACK);
|
|
|
|
|
|
|
|
|
|
|
|
var action = parallel();
|
|
|
|
var animation = parallel();
|
|
|
|
|
|
|
|
var group = new Group();
|
|
|
|
execute(sequence(
|
|
|
|
execute(sequence(
|
|
|
|
run(() -> cardStack.removeAll().forEach(card -> {
|
|
|
|
run(() -> {
|
|
|
|
|
|
|
|
contentRoot.addActorAfter(cardStack, group);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cardStack.removeAll().forEach(card -> {
|
|
|
|
var angle = (card.getRotation() % 360 + 360) % 360;
|
|
|
|
var angle = (card.getRotation() % 360 + 360) % 360;
|
|
|
|
var rotation = rotateTo(angle < 90 || angle > 270 ? 0 : 180, AnimationTimings.STACK_FINISH_ROTATE);
|
|
|
|
var rotation = rotateTo(angle < 90 || angle > 270 ? 0 : 180, AnimationTimings.STACK_FINISH_ROTATE);
|
|
|
|
rotation.setUseShortestDirection(true);
|
|
|
|
rotation.setUseShortestDirection(true);
|
|
|
|
|
|
|
|
|
|
|
|
action.addAction(sequence(
|
|
|
|
|
|
|
|
targeting(card, changeParent(stage.getRoot())),
|
|
|
|
animation.addAction(sequence(
|
|
|
|
|
|
|
|
targeting(card, changeParent(group)),
|
|
|
|
parallel(
|
|
|
|
parallel(
|
|
|
|
targeting(card, rotation),
|
|
|
|
targeting(card, rotation),
|
|
|
|
targeting(card, moveTo(
|
|
|
|
targeting(card, moveTo(
|
|
|
@ -415,11 +434,12 @@ public class GameScreen extends WizardScreen {
|
|
|
|
AnimationTimings.STACK_FINISH_MOVE
|
|
|
|
AnimationTimings.STACK_FINISH_MOVE
|
|
|
|
))
|
|
|
|
))
|
|
|
|
),
|
|
|
|
),
|
|
|
|
targeting(card, alpha(0, AnimationTimings.STACK_FINISH_FADE)),
|
|
|
|
targeting(card, alpha(0, AnimationTimings.STACK_FINISH_FADE))
|
|
|
|
removeActor(card)
|
|
|
|
|
|
|
|
));
|
|
|
|
));
|
|
|
|
})),
|
|
|
|
});
|
|
|
|
action
|
|
|
|
}),
|
|
|
|
|
|
|
|
animation,
|
|
|
|
|
|
|
|
removeActor(group)
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -814,10 +834,13 @@ public class GameScreen extends WizardScreen {
|
|
|
|
private void initTrumpCards() {
|
|
|
|
private void initTrumpCards() {
|
|
|
|
if (trumpCardActor == null) {
|
|
|
|
if (trumpCardActor == null) {
|
|
|
|
trumpCardActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
|
trumpCardActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
|
|
|
|
|
trumpCardActor.setName("trump_card");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (trumpSuitActor == null) {
|
|
|
|
if (trumpSuitActor == null) {
|
|
|
|
trumpSuitActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
|
trumpSuitActor = new CardActor(Card.HIDDEN, atlas);
|
|
|
|
|
|
|
|
trumpSuitActor.setOrigin(0, 0);
|
|
|
|
|
|
|
|
trumpSuitActor.setName("trump_suit");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -825,11 +848,11 @@ public class GameScreen extends WizardScreen {
|
|
|
|
public enum Seat {
|
|
|
|
public enum Seat {
|
|
|
|
FALLBACK(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f, 0, 0, 0, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
FALLBACK(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f, 0, 0, 0, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
BOTTOM(WizardGame.WIDTH * 0.5f, 0, 0, 0, Align.bottom, WizardGame.WIDTH * 0.5f, 300),
|
|
|
|
BOTTOM(WizardGame.WIDTH * 0.5f, 0, 0, 0, Align.bottom, WizardGame.WIDTH * 0.5f, 300),
|
|
|
|
LEFT(0, WizardGame.HEIGHT * 0.5f, 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomLeft, 117.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
LEFT(-324, WizardGame.HEIGHT * 0.5f, 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomLeft, 117.5f, WizardGame.HEIGHT * 0.5f),
|
|
|
|
TOP_LEFT(WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP_LEFT(WizardGame.WIDTH * 0.25f - 144, WizardGame.HEIGHT + 289, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.25f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP(WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT + 324, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.5f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP_RIGHT(WizardGame.WIDTH * 0.75f, WizardGame.HEIGHT, WizardGame.WIDTH * 0.75f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.75f, WizardGame.HEIGHT - 200),
|
|
|
|
TOP_RIGHT(WizardGame.WIDTH * 0.75f + 144, WizardGame.HEIGHT + 289, WizardGame.WIDTH * 0.75f, WizardGame.HEIGHT - 50, Align.top, WizardGame.WIDTH * 0.75f, WizardGame.HEIGHT - 200),
|
|
|
|
RIGHT(WizardGame.WIDTH, WizardGame.HEIGHT * 0.5f, WizardGame.WIDTH - 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomRight, WizardGame.WIDTH - 117.5f, WizardGame.HEIGHT * 0.5f);
|
|
|
|
RIGHT(WizardGame.WIDTH + 324, WizardGame.HEIGHT * 0.5f, WizardGame.WIDTH - 50, WizardGame.HEIGHT * 0.5f + 110f, Align.bottomRight, WizardGame.WIDTH - 117.5f, WizardGame.HEIGHT * 0.5f);
|
|
|
|
|
|
|
|
|
|
|
|
// position of the hand, should be offscreen
|
|
|
|
// position of the hand, should be offscreen
|
|
|
|
private final float handX;
|
|
|
|
private final float handX;
|
|
|
|