e-dt 4 years ago
parent
commit
c9e28e8453
  1. 2
      src/main.rs

2
src/main.rs

@ -139,7 +139,7 @@ impl EventHandler for Apr {
if mouse::button_pressed(ctx, MouseButton::Left) {
let posx = posn.x;
let posy = posn.y;
if posx >= self.__test_pawn_x && posx <= self.__test_pawn_x + 20.0 && posy >= self.__test_pawn_y && posy <= self.__test_pawn_y + 20.0 { //In real game don't hardcode size
if posx >= self.__test_pawn_x && posx <= self.__test_pawn_x + BOARD_SQUARE_SIZE && posy >= self.__test_pawn_y && posy <= self.__test_pawn_y + BOARD_SQUARE_SIZE {
self.__test_pawn_h_x = self.__test_pawn_x - posx;
self.__test_pawn_h_y = self.__test_pawn_y - posy;
self.__test_pawn_held = true;

Loading…
Cancel
Save