5 Replies - 4428 Views - Last Post: 22 January 2010 - 09:35 PM

#1 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Monopoly Alike Game

Posted 21 January 2010 - 05:24 PM

Ok I was asked by my teacher to build something that should look like the monopoly board, There has to be dice and figures for the players, cards, money .........

so i was thinking of starting the game but, I am having problems, i want to do it in 3D but i have never worked with 3D stuff before, and while looking around the web, a lot of people recommend XNA (obviously) but, so I tried XNA but I am having the worst time trying to load this .fbx cube file, well even worst i couldnt do it lol :P

So i decided to do something easier and do the proyect with 2D, now my question is, is there a way to simulate DiceRoll in 2D or should i just show the pictures of each side of the dice, randomly according to a variable that would be random with the images loaded in an array?

Is This A Good Question/Topic? 0
  • +

Replies To: Monopoly Alike Game

#2 Notorion  Icon User is offline

  • D.I.C Regular

Reputation: 35
  • View blog
  • Posts: 378
  • Joined: 17-February 09

Re: Monopoly Alike Game

Posted 21 January 2010 - 05:32 PM

What I would do is the second idea to start with. Then you could maybe add an animation in later. It would be GREAT practice for you to do so, but you would want to make sure the nuts and bolts work first. For example rent, and property and money rewards are calculated properly.
Was This Post Helpful? 0
  • +
  • -

#3 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: Monopoly Alike Game

Posted 21 January 2010 - 06:29 PM

Yea you are probably right, I heard somewhere you could do 3D like objects using 2D, well ill just give it a go in 2D either way the board and everything is simpler also in 2D

Thanks for the reply by the way :)
Was This Post Helpful? 0
  • +
  • -

#4 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Monopoly Alike Game

Posted 21 January 2010 - 07:20 PM

View Postponcho4all, on 21 Jan, 2010 - 07:24 PM, said:

So i decided to do something easier and do the proyect with 2D, now my question is, is there a way to simulate DiceRoll in 2D or should i just show the pictures of each side of the dice, randomly according to a variable that would be random with the images loaded in an array?


Yes, there is a way that you can do what you want to do with the dice. You can have 6 images loaded into an array of Texture2D and read them in the LoadContent method.

// Class level field
Texture2D[] dieFaces = new Texture2D[6]; 

// In LoadContent
dieFaces[0] = Content.Load<Texture2D>("image1");
dieFaces[1] = Content.Load<Texture2D>("image2");
dieFaces[2] = Content.Load<Texture2D>("image3");
dieFaces[3] = Content.Load<Texture2D>("image4");
dieFaces[4] = Content.Load<Texture2D>("image5");
dieFaces[5] = Content.Load<Texture2D>("image6");



Now, if you have a field that holds the roll of the die between 1 and 6 you can use that to decide which image to draw.

Also, moving this to the XNA forum
Was This Post Helpful? 1
  • +
  • -

#5 poncho4all  Icon User is offline

  • D.I.C Head!
  • member icon

Reputation: 123
  • View blog
  • Posts: 1,405
  • Joined: 15-July 09

Re: Monopoly Alike Game

Posted 22 January 2010 - 04:19 PM

Thanks for that SixOfEleven.

Anyone know if there is a way to move the picture(the picture being a monopoly like board), Ive loaded the board and set it to be a bit 3D looking like, in a position where you can only see, the line closest to the screen say only one side, is there a way to make it move only when the player goes on the other side with its coin?

Also is there a way to make the image smaller, my image doesnt fit completely.

This post has been edited by poncho4all: 22 January 2010 - 06:27 PM

Was This Post Helpful? 0
  • +
  • -

#6 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Monopoly Alike Game

Posted 22 January 2010 - 09:35 PM

You can do both of those without much problem actually. There is an overload of the Draw method of SpriteBatch that has parameters for scaling and rotation, the 6th overload in the list I believe. The parameters are the Texture2D to be drawn, a Vector2 for the position of the image, the source rectangle, the tint color, the rotation, the origin, the scale, SpriteEffects and layerDepth.

Texture2D it the image
position would be where you want to draw the image
source rectangle is the source rectangle of the image, you can pass in null to ignore this parameter
rotation is the angle measured in radiang
origin is the point you want to rotate the image around, you probably want the center of your image
scale is how you want to scale the image
SpriteEffects lets you specify and effects such as flipping the image horizontally or vertically
layerDepth is a value between 0.0 and 1.0. Usually you can safely set this to 1.0 all the time. If you want to use it you have to use SpriteSortMode.FrontToBack or SpriteSortMode.BackToFront for this to work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1