Here is a picture of what I would like to do. The 1's are being used to test. In the final version, I would like to use the game settings to save high scores in a 3 x 3 x 2 array.
In this test, the SpriteFont shows the number at position 1,1,1. When the score is greater than the highscore at that position, it sets that position to the score. However, in game, the SpriteFont never changes and displays a zero no matter how high the score goes. What am I doing wrong?
Clarification edit: The "Every tick" is not a sub event of anything else. Any advice would be appreciated!
Indexing starts at 0, not 1, so you should be starting at 0,0,0.
Develop games in your browser. Powerful, performant & highly capable.
Ok, but isn't there also a value at the position 1,1,1 in a 3x3x2 array? Regardless of where I start, why isn't it able to set and display a value at a specified position?
It wasn't clear what sizes you are using. You said the final version would be 3,2,2, but if you didn't change that now, the default would be 10,1,1, which would fail to work at index 1,1,1.
It's out of the bounds of the array so always returning 0, you need to set the size of the array.
Ah, fair point, I should have been more clear. The current array (the one used when this example was run) has a width of 3, height of 3, and depth of 2.
Any idea why the example in the picture isn't working?
Solved, thanks to blackhornet!
My solution was to delete my array and redo it. I'm not sure why that fixed it, but it worked!