Hi all,
Is it possible to make a Rubik's cube game? Is there something you can use to have the computer memorize a 3d 3X3X3 Cube's squares and their colors?
Printable View
Hi all,
Is it possible to make a Rubik's cube game? Is there something you can use to have the computer memorize a 3d 3X3X3 Cube's squares and their colors?
I imagine the easiest way would be to use a 3d array, and have a different number for each colour. Then represent the array on the screen and manipulate the values when the player turns different segments... although I'm not going to sit here and work it out. Thats just where i would start if i was making it.
Cool... Thanks
this isn't as easy as it seems. A normal 3x3x3 array would remember say the colours of the blocks. But you want the colours of the seperate sides of the blocks. Therefore you might use a normal 1 dimensional array or list box.
You'll need 9x6 = 54 entries which all relate to each other.
When creating the array for the first time then if you want it random then create another listbox with all the squares in it and then cut random values from it.
You would have to work out a view for the whole thing - rotating it would be easy with the array.
If you want to shift say a whole row arround then you have to find the values on the "circumference" of the square and shift them 3 places. This would be rather fiddly so it would be best if you draw a net of the cube and all the IDs of the sides so you can work out what goes where.
Ah yes, you make a very good point. I was merely thinking of a structure that would hold the data of each block, not each side of each block.
Sorry if i confused anyone!
I'm not really sure, but you might want to look into the Advanced Game Board object for the shifting of blocks and so on.
errr. ok thanks for the extra clearifying info.
not the advanced game board. Because of the nature of the cube you would have to wrap the board at other places than each columns and rows. Ill have a look and see what I can come up with.
it can be done easily enough for someone who knows how :P
my advice is start with an easier typical "beginners-game to mmf" - ie, A MMORPG or something XD
well I'll work it out for you then ;)