0
Ayuda por favor, estoy haciendo un juego de quoridor pero no sé como hacer para validar el movimiento de los peones
Help please, I'm playing a quoridor game but I don't know how to validate the movement of the pawns I must do the pawn movement restrictions in java, which are, the pawns should move to one square, either sideways or up or down and not move diagonally, if you can help me I will be very grateful Debo hacer las restricciones de movimiento del peón en java, que son, los peones se deben mover de a una casilla, ya sea a los lados o arriba o abajo y no moverse en diagonal, si me pueden ayudar estaré muy agradecido
9 Antworten
+ 1
the code is in java language, I have programmed it in the eclipse ide
0
In order to figure out the logic we need the code. Could you please post a link to it?
0
Juan pablo Peña Yes, I need to see the code.
0
Or at least can you explain how exactly the piece moving works. Is it grid based? Or what
0
yes, the game is a board a board that is made up of ascii codes, the pawn can move sideways, up and down but I don't know how to validate the movements,
el usuario ingresa el movimiento por coordenadas X y Y, el tablero es de 9x9
0
Are the pieces objects? If so one way to fix this is adding a position attribute to each piece, so when you move it, before the move is rendered test if it is valid.
0
The pieces of the game are * and +, then the player gives the coordinates and the tile moves to where it asks
0
Then it just seems like simple if/else logic.
0
but I don't know how to do it bro, if you can help me I will be very grateful