I don't really understand the Fetch button. I see from the code that it's supposed to set the array value, but can we see this on the screen?
No matter what values have been stored, and what values are currently on the slider, "Fetch" does nothing more (visibly) than set the Array Value slider to zero.
An array is a group of values. Each value has an x (horizontal) position, if the array is 2-dimensional a y position (vertical), and if the array is 3-dimensional a z position (I guess, how far away it is).
This is very good but it doesn't get past the issue of not having an array data structure for sprites. There's a space invaders example that would work well with arrays but the person had to instantiate each "badguy" as an independant sprite.
To use, simply set the array position to the desired location, and then select a value.
I've converted this to a two-dimensional array as an additional experiment.
The "Record" button merely assigns a value into the array, and the "Fetch" button reads that value back out.
This example is designed to completely remove these buttons so the array can be used in other scripts, with the limitation that the values of this array are unfortunately visible to the user.
Comments
You need to be logged in to post comments
Add a Comment
? ?
(view all replies)Comment Reply
I don't really understand the Fetch button. I see from the code that it's supposed to set the array value, but can we see this on the screen? No matter what values have been stored, and what values are currently on the slider, "Fetch" does nothing more (visibly) than set the Array Value slider to zero.
(view all replies)Comment Reply
An array is a group of values. Each value has an x (horizontal) position, if the array is 2-dimensional a y position (vertical), and if the array is 3-dimensional a z position (I guess, how far away it is).
(view all replies)Comment Reply
What's an array?
(view all replies)Comment Reply
This is very good but it doesn't get past the issue of not having an array data structure for sprites. There's a space invaders example that would work well with arrays but the person had to instantiate each "badguy" as an independant sprite.
(view all replies)Comment Reply
Very useful demo. I'll be pointing to this URL in a forum thread about useful demo projects.
(view all replies)Comment Reply