Forums Register Login

plz help on moving things

+Pie Number of slices to send: Send
hi all ,i have never programmed a game
and i need to make a chess game
i have 2 choices:
1: 2 persons over a network
2: versus a computer

i think that the first choice is the easiest
so i will move the pieces with the method
rehape(int , int , int , int)
and all the pieces are JLabel.
is it ok or there is another way more easy !
plz help me coz i have 10 days do finish the game
thx .
+Pie Number of slices to send: Send
Option one is much better than two. With two, you have to come up with some sort of AI logic to play.
+Pie Number of slices to send: Send
Another point is that your rehape(int , int , int , int) method will have to take account of the behaviour of the different pieces (i.e. to trap illegal moves). I would think about using maybe a chess piece interface, and then a load of classes to define each type of piece, or a basic piece class from which the others inherit.
+Pie Number of slices to send: Send
I'd say a more generic boardgame solution with a plugin validation engine would be best.
Give each type of piece an identifier in the validation engine which each individual piece gets assigned the proper one on construction.
Similarly have the validation engine describe the board dimensions as well.

Each move entered will be handed off to the engine which will do the validation to check if it's a legal move.
That way the pieces themselves can be generic (a graphic representation can be chosen by a game specific display engine based on the piece type taken from the validation engine and referenced in the piece itself) and that part of the system can remain identical if at a later date you want to create checkers as well (for example).
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1019 times.
Similar Threads
MultiDimensional array doesnt work
Help with a chess program
chess game ;array_bug ;selection_of_pieces_in_chess_game
Someone, everyone, PLEASE HELP ME ON A PROJECT!!
Help :) 2d array and graphics :)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:23:20.