Thanks for the example project you added, oosyrag. I think this works but my version's not much different other than how I have the strings attached to arrays rather than the buttons you have in yours. Not sure how much difference that makes.
There are too many moving parts to really show the whole thing, but here's what I do:
- First, I have an array that's 4 by 2. The first row (y=0) has the names of the people ("bob", "sam", "jim", etc.), and the second row (y=1) has the numerical rating value that I'm associating with the name. Ends up looking like: "bob, 1" "sam, 4" "jim, 20" etc.
- Next, I have a layout that throws compound sprites (one base sprite with another sprite pinned to it at creation) across the screen with bullet speed, and the player has to tap them before they go off screen to get points. Upon tap, the sprite is destroyed, but when it's first created I wanted to associate values from the array with the sprite. So the base sprite has 4 frames, and the pinned sprite has 6. Depending on the y=0 (name of people) value of the array, and the x column of the array, I want to select a frame of the pinned sprite to associate with "bob" or "sam" or "jim".
- At the same time of creation of the base sprite, with the y=1 (person rating) value of the array, and the x column of the array, I want set the frame of the base sprite according to the value (i.e., if less than 5, frame 1, if between 5 and 10, frame 2, etc.).
I hope this is better info. Like I said, I can't really pull this whole thing out of the system and have it work how I'm trying to explain....I mean....maybe I can try to put something together. I guess I've been avoiding building an entirely separate example project.
Tell you what, if above is not enough, I'll put together a project to the best of my ability. I'm still pretty new to game dev (only like <5 years), so I've just wanted to stick to this one project while I'm focused on it.