New to XNA. Would love to hear your input in how to set up my clases for my Domino game. So far, I have a “BonesSprite” class which has fields like first value, second value, orientation, position etc. I have code on the LoadContent method which creates a List for each bone as shown in the code below.
Background = Game.Content.Load<Texture2D>(@"Images\Wood");
//Load several different automated sprites into the list
fichasList.Add(new Ficha(Game.Content.Load<Texture2D>(@"Images/46"),
10, Vector2.Zero, new Vector2(150, 150), 0, 0, true, true));
This is what i have so far: http://i129.photobucket.com/albums/p239/itsshortforleo/Untitled-1copy.jpg
I still can’t come up with:
- How to deal 7 bones to each player (I have an empty Player class that i don’t know how to fill yet)
- How to place the 7 bonesprites on the board so that only player 1 can see his bones and not the other players’
- How to click on one bone to play it on the board on the exact position right next to the other bone and in the correct orientation
- How can I highlight a bone when i have the mouse over it
The game seemed so simple to me until I started designing the classes. Appreciate your help.
Just a few ideas for your consideration:
You can deal with (1) and (2) simply. Make a Player and Bone class. Add to the Bone a field “owner” so that you can assign a Player to it. You did not write whether it is going to be turn-based “hot seats” or network game, nevertheless you’ll get the correct bones to display just by checking their correcponding “owners” in a loop.
These are basics of the object oriented programming, I suggest you to read more about these concepts before starting a game. It won’t take much time but it will make your life easier.
(4) First think how to get a correct bone recognized when clicking.
As others suggested you should also split your questions, (1) and (2) can go together, others not.