From 9b7567a9665ab65123d5463c8a288eda917b1117 Mon Sep 17 00:00:00 2001 From: JBM Date: Fri, 22 May 2020 22:13:15 +0200 Subject: [PATCH] Break stone counter. FIX AVATAR DEFEAT ANIMATION AT LAST!!!cos0!! --- src/main/java/com/codingame/game/View.java | 67 ++++++++++---------- src/main/resources/view/assets/frame.png | Bin 0 -> 6736 bytes src/main/resources/view/assets/frame_bg.png | Bin 0 -> 817 bytes 3 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 src/main/resources/view/assets/frame.png create mode 100644 src/main/resources/view/assets/frame_bg.png diff --git a/src/main/java/com/codingame/game/View.java b/src/main/java/com/codingame/game/View.java index 65bacea..dd350fe 100644 --- a/src/main/java/com/codingame/game/View.java +++ b/src/main/java/com/codingame/game/View.java @@ -37,34 +37,34 @@ class View { int x = p0 ? 280 : 1920 - 280; int y = 220; - Rectangle border1 = graphicEntityModule - .createRectangle() - .setWidth(140) - .setHeight(140) - .setX(x - 70) - .setY(y - 70) - .setLineWidth(0) - .setFillColor(colorToken); - - Rectangle border2 = graphicEntityModule - .createRectangle() - .setWidth(120) - .setHeight(120) - .setX(x - 60) - .setY(y - 60) - .setLineWidth(0) - .setFillColor(0xffffff); + Sprite border1 = graphicEntityModule.createSprite() + // .setX(x) + // .setY(y) + .setImage("frame.png") + .setAnchor(0.5) + .setScale(p0 ? -1 : 1) + .setZIndex(22) + .setTint(colorToken); + + Sprite border2 = graphicEntityModule.createSprite() + // .setX(x) + // .setY(y) + .setImage("frame_bg.png") + .setAnchor(0.5) + .setZIndex(20); Sprite avatarSprite = graphicEntityModule.createSprite() - .setX(x) - .setY(y) - .setZIndex(20) - .setImage(avatarToken) - .setAnchor(0.5) - .setBaseHeight(116) - .setBaseWidth(116); + // .setX(x) + // .setY(y) + .setZIndex(21) + .setImage(avatarToken) + .setAnchor(0.5) + .setBaseHeight(116) + .setBaseWidth(116); - avatar = graphicEntityModule.createGroup(border1, border2, avatarSprite); + avatar = graphicEntityModule + .createGroup(border1, border2, avatarSprite) + .setX(x).setY(y); Text text = graphicEntityModule.createText(nicknameToken) .setX(x) @@ -113,7 +113,7 @@ class View { void setStone() { int stones = model.getStones(); if (stones <= 0) { - stoneCounter.setText("No stones!"); + stoneCounter.setText("Out of stones!"); stoneCounter.setFillColor(0xff7777); } else if (stones == 1) { @@ -124,6 +124,7 @@ class View { stoneCounter.setText(stones + " stones"); } } + void animateStones(int stones) { stone.setX(castle.getX()); stone.setY(castle.getY() - 100); @@ -144,18 +145,19 @@ class View { stone.setAlpha(0, Curve.EASE_IN); graphicEntityModule.commitEntityState(0.5, stone); } + void displayMessage(String msg) { message.setText(msg); graphicEntityModule.commitEntityState(0, message); } void destroy() { - avatar.setRotation(170*Math.PI/180, Curve.ELASTIC); + avatar.setRotation(170*Math.PI/180, Curve.ELASTIC); - graphicEntityModule.commitEntityState(0.5, castle); - castle.setX(castle.getX(), Curve.ELASTIC); - castle.setScaleY(-0.2, Curve.EASE_IN); - } + graphicEntityModule.commitEntityState(0.5, castle); + castle.setX(castle.getX(), Curve.ELASTIC); + castle.setScaleY(-0.2, Curve.EASE_IN); + } } Model model; @@ -166,10 +168,11 @@ class View { void init(Model m) { model = m; + drawBackground(); + p0.init(gameManager.getPlayer(0)); p1.init(gameManager.getPlayer(1)); - drawBackground(); drawTroll(); } diff --git a/src/main/resources/view/assets/frame.png b/src/main/resources/view/assets/frame.png new file mode 100644 index 0000000000000000000000000000000000000000..5f815887a5ad1bce3a611aa5b97ac5a0115491c7 GIT binary patch literal 6736 zcmV-W8n5MvP)EX>4Tx04R}tkv&MmKpe$iQ%glEA{Hs4kfAzR5EXIMDionYs1;guFuC+YXws0h zxHt-~1qVMCs}3&Cx;nTDg5U>;lcSTOi!ES_(b9vW|$S?b>gYb ziotoGILwN&N_z1bM0hc>KYWp0v_t)c^nh24YJ`L;wH)0002_L%V+f000SaNLh0L z04^f{04^f|c%?sf00007bV*G`2jm475hw#CBSKIB000?uMObu0Z*6U5Zgc=ca%Ew3 zWn>_C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