The following code generates random numbers (1-6) for an animated die that could be used in a game.
The code was partially generated with Claude assistance.
https://i.ibb.co/6R1jqbGH/dice.png
Printable View
The following code generates random numbers (1-6) for an animated die that could be used in a game.
The code was partially generated with Claude assistance.
https://i.ibb.co/6R1jqbGH/dice.png
The die is poorly designed; the sum of the value of one face and the opposite face is always 7. In the image, you can see that the 6 is adjacent to the 1.
Thanks for your remarque, I admit I didn't check the order of the faces since it doesn't really affect the random selection process, but I agree that it should look like a real die.
I put new order for faces (in DrawRotatedCube)
And to display the correct face label:Code:DrawPoly p, Array(4, 5, 6, 7), 5
DrawPoly p, Array(2, 3, 7, 6), 3
DrawPoly p, Array(3, 2, 1, 0), 2
DrawPoly p, Array(0, 1, 5, 4), 4
DrawPoly p, Array(3, 0, 4, 7), 1
DrawPoly p, Array(1, 2, 6, 5), 6
in RandomFace
Hope this works.Code:Dim labels
labels = Array(5, 3, 2, 4, 1, 6)
..
List1.AddItem labels(fs)