mobile -> enable combat arrows on 2 player

This commit is contained in:
Anthony Calosa
2024-09-29 20:41:20 +08:00
parent ddf009fed5
commit ea9aab7c4f
2 changed files with 5 additions and 4 deletions

View File

@@ -320,16 +320,17 @@ public class Graphics {
fillCircle(skinColor.getColor(), x2, y2, arrowThickness); fillCircle(skinColor.getColor(), x2, y2, arrowThickness);
drawLineArrow(arrowThickness, skinColor.getColor(), x1, y1, x2, y2); drawLineArrow(arrowThickness, skinColor.getColor(), x1, y1, x2, y2);
fillCircle(Color.WHITE, x2, y2, arrowThickness / 2); fillCircle(Color.WHITE, x2, y2, arrowThickness / 2);
drawLine(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2); drawLineArrow(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2);
//drawLine(arrowThickness / 3, Color.WHITE, x1, y1, x2, y2);
} }
public void drawLineArrow(float thickness, Color color, float x1, float y1, float x2, float y2) { public void drawLineArrow(float thickness, Color color, float x1, float y1, float x2, float y2) {
batch.end(); //must pause batch while rendering shapes batch.end(); //must pause batch while rendering shapes
float angle = new Vector2(x1 - x2, y1 - y2).angleRad(); /*float angle = new Vector2(x1 - x2, y1 - y2).angleRad();
float arrowHeadRotation = (float) (Math.PI * 0.8f); float arrowHeadRotation = (float) (Math.PI * 0.8f);
Vector2 arrowCorner3 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle + arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle + arrowHeadRotation)); Vector2 arrowCorner3 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle + arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle + arrowHeadRotation));
Vector2 arrowCorner4 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle - arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle - arrowHeadRotation)); Vector2 arrowCorner4 = new Vector2(x2 + (thickness / 3) * (float) Math.cos(angle - arrowHeadRotation), y2 + (thickness / 3) * (float) Math.sin(angle - arrowHeadRotation));*/
if (thickness > 1) { if (thickness > 1) {
Gdx.gl.glLineWidth(thickness); Gdx.gl.glLineWidth(thickness);

View File

@@ -479,7 +479,7 @@ public class MatchScreen extends FScreen {
//draw arrows for combat //draw arrows for combat
final CombatView combat = game.getCombat(); final CombatView combat = game.getCombat();
for (CardView c : cardsonBattlefield) { for (CardView c : cardsonBattlefield) {
TargetingOverlay.assembleArrows(g, c, endpoints, combat, is4Player() || is3Player() ? playerViewSet : null); TargetingOverlay.assembleArrows(g, c, endpoints, combat, playerViewSet);
} }
} catch (Exception e) { } catch (Exception e) {
} }