Short and sweet. Again...
Still having issues with getting the shape to turn. This was really cutting into my time doing other things in the past, so I figured I'd at least finish a different process of the game. This bit of code was for randomizing the shapes to load during the start of the game. Luckily, this was probably the easiest thing I've done so far.
There's only 7 shapes right now because of the small scope of the game. It was simply a matter of referencing those different names when picking the asset from the location.
What's happening above is that I put the shapes into a list called a string array. As we will see, the index variable will come in handy to pick which file name to choose in the list with the help of a different bit of code.
The shapeIndex variable is set by picking a random number between zero and the length of the list - in this case it's 7. After that, I pick a shape in the list based on the number we got from the shapeIndex variable. This name is stored in the variable called initialShape.
Whatever name in the array that was chosen is then used in the next bit of code which actually calls the asset from the location. So it could be "3-D Shapes/Shapes/" + "Cone" (or some other shape name) which obviously creates the filepath 3-D Shapes/Shapes/Cone.
The shape is then saved onto a variable, which lastly, gets loaded as the variable 'shape'.
And presto, we get a somewhat random shape each time. Beautiful!
Now to work on that shape rotation issue 😒😒.