Skip to content

Commit

Permalink
updated visual look, fixed pan bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Slavrick committed May 20, 2021
1 parent 033d5a9 commit 0d59992
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
Binary file modified bin/GUI/ChessDrawer.class
Binary file not shown.
Binary file modified bin/GUI/Controller.class
Binary file not shown.
Binary file modified res/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/Pieces-hirez.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions src/GUI/ChessDrawer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ChessDrawer {
public static Color multiverseDark = Color.rgb(148,180,116);
public static Color arrowColor = Color.rgb(147,112,219);

private static final int SPRITEWIDTH = 32;
private static final int SPRITEWIDTH = 128;
private static final int SPRITESHEETWIDTH = 10;
public static int squarewidth = 32;
public static int halfSquare = squarewidth / 2;
Expand Down Expand Up @@ -203,7 +203,7 @@ public static void drawColoredTimeline(GraphicsContext gc, int x, int y, int scr
public static void drawFullBoardV(GraphicsContext gc, Board b, boolean color, boolean playable, int x, int y, int screenx, int screeny) {
if (piecesprites == null) {
try {
piecesprites = new Image(new FileInputStream("res/PieceSprites.png"));
piecesprites = new Image(new FileInputStream("res/Pieces-hirez.png"));
} catch (FileNotFoundException e) {
System.out.println("Cannot find the Image :l");
e.printStackTrace();
Expand Down Expand Up @@ -283,11 +283,9 @@ public static void drawAllSquaresV(GraphicsContext gc, Color c, ArrayList<CoordF
}

public static void drawMoveLine(GraphicsContext gc, DrawableArrow da, int screenx, int screeny) {
gc.setFill(Color.RED);
gc.setLineWidth(4);
gc.setStroke(Color.RED);
gc.setLineWidth(3);
gc.setStroke(Color.CORNFLOWERBLUE);
gc.strokeLine(da.startX - screenx + halfSquare, da.startY - screeny + halfSquare, da.endX - screenx + halfSquare, da.endY - screeny + halfSquare);

}

public static int coordToX(CoordFour square, boolean color, int width, int height) {
Expand Down
2 changes: 1 addition & 1 deletion src/GUI/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ public static boolean alContains(ArrayList<CoordFour> al, CoordFour target) {
}

private void panToBoard(int T, int L) {
int pany = (L - g.minTL) * (ChessDrawer.padding + (ChessDrawer.squarewidth * g.height)) - 30;
int pany = (L) * (ChessDrawer.padding + (ChessDrawer.squarewidth * g.height)) - 30;
int panx = ((T - 1) * 2) * (ChessDrawer.padding + (ChessDrawer.squarewidth * g.width)) - 30;
screenX = panx;
screenY = pany;
Expand Down

0 comments on commit 0d59992

Please sign in to comment.