Re: C# newbie graphics help
To really make a trivial pursuit shaped board, that's ALOT of drawing commands. You could use GDI+ but that's going to take alot of math, or alot of repitition. An easier way might be to draw the board first using MS Paint or something else, and draw the Game pieces using GDI+. The next problem you run into is that the "pie" places on the board are bigger than the regular places, so you have to move the piece accordingly.
The way I would go about it, because of the difficulty in calculating where to put pieces, is this:
There are off the top of my head, 36 positions in the spokes, 1 in the center, and 42 around the circle. I would first make a GamePosition class, with the following properties:
X,Y - The position on the board.
PositiontoLeft - a reference to another gameposition
PositiontoRight - same as above.
The problem with this is that certain places have certain possible movement paths that are difficult to calculate -i.e, if you're at the spoke, you can go up, through the middle, and then in any direction but the way you came.
I would then make a make a "gamepiece" control with boolean properties for each color piece, and a position property, which is of the above made GamePosition class. Draw the Piece on the board by drilling down into the gamePosition class and getting the values out.
The hardest part of all I think is going to be determining possible moves. The drawing won't be that complicated for just the pieces, if you use a custom control for the pieces. Heh, when's this sucker due? This doesn't sound like a first year project by any means.
Bill
Re: C# newbie graphics help
Thanks for taking time to reply conipto. I had kinda guessed that drawing the board would be very difficult, so I have drawn myself a graphic to represent the board just incase I decided to go down that route.
The game itself doesnt have to be a full implementation of a Trivial Pursuit game. By that I mean, things such as prize wedges dont need to be implemented, keeping score of how many questions a player has answered would be sufficient for that particular feature.
So if I used your idea for the pieces, would I move them around the board by simply re-drawing them on the board at a certain location whenever they are moved? What I mean is, would I use the mouse to drag the piece around the board, or just have the game re-draw that particular piece on the board at the correct location?
Also, as regards to the pieces, I was planning on having a class called Player which would represent each player taking part in the game. Now each player would obviously have to own a piece, so would I just have my Piece class as a property of my Player class, or could I just use the Piece class to represent each player by just adding another property to it (maybe name), and forgetting about the Player class altogether?
I still have a few weeks to complete this, and like I say, its not a complete version of the game that I need to implement, its not a computer games course that Im taking.
Re: C# newbie graphics help
Hi, I'm making a project for school. I would like to ask if you could done your project and if you cold send me some code because I do not know where to start. THanks
;)