use of com.janfic.games.computercombat.ComputerCombatGame in project computercombat by janfic.
the class AndroidLauncher method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new ComputerCombatGame(), config);
}
use of com.janfic.games.computercombat.ComputerCombatGame in project computercombat by janfic.
the class DesktopLauncher method main.
public static void main(String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = 1920 / 2;
config.height = 1080 / 2;
config.resizable = true;
new LwjglApplication(new ComputerCombatGame(), config);
}
use of com.janfic.games.computercombat.ComputerCombatGame in project computercombat by janfic.
the class DrawAnimation method animate.
@Override
public List<List<Action>> animate(String currentPlayerUID, String playerUID, MatchScreen screen, float animationSpeed) {
Table leftPanel = screen.getLeftPanel();
Table rightPanel = screen.getRightPanel();
Table panel;
if (playerUID.equals(currentPlayerUID)) {
panel = leftPanel;
} else {
panel = rightPanel;
}
List<List<Action>> animations = new ArrayList<>();
ComputerCombatGame game = (ComputerCombatGame) Gdx.app.getApplicationListener();
if (newSoftware.size() > 0) {
List<Action> cardAnimation = new ArrayList<>();
Table t = new Table();
t.setFillParent(true);
Card loadNewCard = SQLAPI.getSingleton().getCardById(newSoftware.get(0).getID(), newSoftware.get(0).getOwnerUID());
loadNewCard.setMatchID(newSoftware.get(0).getMatchID());
CollectionCard card = new CollectionCard(game, screen.getSkin(), loadNewCard, 1);
card.setTouchable(Touchable.disabled);
Stage stage = screen.getMainStage();
stage.addActor(t);
card.setVisible(false);
card.setPosition(stage.getWidth() / 2, -300);
t.add(card).expand().center();
Action cardAction = Actions.sequence(Actions.moveBy(0, -400), Actions.visible(true), Actions.moveBy(0, 400, 1 * animationSpeed, Interpolation.fastSlow), Actions.delay(1 * animationSpeed), Actions.moveBy(0, -400, 1 * animationSpeed, Interpolation.slowFast));
cardAction.setActor(card);
cardAnimation.add(cardAction);
animations.add(cardAnimation);
List<SoftwareActor> softwareActors = screen.getSoftwareActors().get(currentPlayerUID);
ComputerActor computerActor = screen.getComputerActors().get(currentPlayerUID);
List<Action> softwareAnimation = new ArrayList<>();
SoftwareActor softwareActor = new SoftwareActor(screen.getSkin(), !playerUID.equals(currentPlayerUID), loadNewCard, game);
panel.clear();
for (SoftwareActor s : softwareActors) {
panel.add(s).row();
}
panel.add(softwareActor).row();
panel.add(computerActor).expandY().growX().bottom();
softwareActor.setVisible(false);
softwareActors.add(softwareActor);
Action softwareActorAction = Actions.sequence(Actions.moveBy(0, -400), Actions.visible(true), Actions.moveBy(0, 400, 1 * animationSpeed, Interpolation.fastSlow));
softwareActorAction.setActor(softwareActor);
softwareAnimation.add(softwareActorAction);
animations.add(softwareAnimation);
}
return animations;
}
Aggregations