Will Downie

Greenhorn
+ Follow
since May 09, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Will Downie

Ok, so I am creating a simplified chess game. In my game, it's the same board and rules of chess, except there's only pawns. I have a GUI displaying a board, but I need some help. How would I make a MouseListener that would enable me to move one pawn from one square to another? Additionally, I will run into the problem of whether or not that pawn's path is blocked. I guess my problem right now is being able to use the board I have, and somehow assign it a coordinate grid? Or something? I figured a coordinate grid would enable simple pawn movement, like y + 1 to move it forward, or something. I'm not sure.
I guess if anyone had any old code laying around to help me out I would really appreciate it.

11 years ago
Ok, so as mentioned in the title, I am not very experienced with Java. I am making a Chess project, or I am attempting to, anyway. I have a super class Piece, then the other pieces, Rook, Pawn, etc. which extend Piece. Now, I plan on making a isValid() method to essentially move the pieces...except I have no idea which parameters I should use...or what I should even do anyway. Below is the code for Piece, and Rook and Pawn, which are unfinished. And yeah, the grid[][] in Pawn was my failed attempt at actually trying to do something.

11 years ago