XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Numbers on faces(NOOB)

Last post 11/21/2009 12:56 PM by FuzzyDon. 4 replies.
  • 11/19/2009 3:05 PM

    Numbers on faces(NOOB)

    Hi,
    Im still new at the coding part of XNA and need some help. Can some one please try explain to me how to generate a number on a face of a tile but here is the catch. The number cannot be the same as other numbers in the same line or be duplicated within a square. Its for a sudoku game?
  • 11/19/2009 3:42 PM In reply to

    Re: Numbers on faces(NOOB)

    Your best bet would be to design a model that is a cube the shape of the tile (pretty easy...).  Then design 9 textures, one for each number.  You can use BasicEffect, just set the texture to one of the 9 textures for the model.
  • 11/20/2009 5:28 AM In reply to

    Re: Numbers on faces(NOOB)

    Answer
    Reply Quote
    That sounds like a plan. Would i then need to use the Update functions to do the logic behind the checking on which block is where and not to duplicate it?
  • 11/20/2009 4:10 PM In reply to

    Re: Numbers on faces(NOOB)

    Rather than do that, I would make a class for your Sudoku tiles so you can keep all the relevant data together.  One of the fields and properties will be the integer value of the tile, you can use that to ensure you don't use the same one twice.  This integer value can also tell that class what its texture name is (i.e. if the value for that class is 3, then it's texture would be located at "Textures\Tiles\3".  Then you can make a 9x9 array of these tiles and fill them in as appropriate.
  • 11/21/2009 12:56 PM In reply to

    Re: Numbers on faces(NOOB)

    Thank you very much.
Page 1 of 1 (5 items) Previous Next