On Fri, 23 May 2008 07:14:08 -0400, inhahe wrote:
The logic part has the rules how you may move the pieces. The GUI
shouldn't have to know how a knight, bishop, or queen can move or
what castling is.
No it isn't! The size is independent from the GUI. Most 2D strategy
games have maps that are way large than the GUI displays at once. You
almost always see just a portion of the model of the game world in the GUI.
There are plenty of reasons. You tie the game to one GUI this way. No
way to change the GUI toolkit or to split the game into server (game
logic) and client (different GUIs, web application).
Ciao,
Marc 'BlackJack' Rintsch
<purelyacademic >If the GUI defines that it's a board layout like chess or
checkers and the player will move around the board, it's hard to say what's
left for the "logic" part to do.
checkers and the player will move around the board, it's hard to say what's
left for the "logic" part to do.
shouldn't have to know how a knight, bishop, or queen can move or
what castling is.
I can't think of any generalization for the fact that it's a 2D strategy
game. You could have a 2-dimensional array, the size of which is
determined by the GUI,
game. You could have a 2-dimensional array, the size of which is
determined by the GUI,
games have maps that are way large than the GUI displays at once. You
almost always see just a portion of the model of the game world in the GUI.
but even motion on it would have to be defined by the GUI, in which case
the GUI would simply be using the "logic" part for storing the array and
accessing it via index values. And then there's no reason not to put
the array inside the GUI.
the GUI would simply be using the "logic" part for storing the array and
accessing it via index values. And then there's no reason not to put
the array inside the GUI.
way to change the GUI toolkit or to split the game into server (game
logic) and client (different GUIs, web application).
Ciao,
Marc 'BlackJack' Rintsch