mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
mobile -> enable combat arrows on 2 player
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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) {
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user