cybereality
Sorry if I wasn't clear enough.
Ideally, I'd like to make a typing game.
There would be different "words" represented by images that would fall down at random speeds or timings, and the player would have to input the corresponding word for each "image".
If the entered word is correct, then the corresponding word gets deleted, otherwise, it hits the "player zone" at the bottom of the screen and remove a point on the player's health.
The challenge here is that the player would have to input the words in the order they appear on screen. Say there are two "water" words on screen, the first one (closer to the player zone) must be dealt with before the second one.
Because the words get spawned randomly by timer, I'd like to make sure the player has the time to enter the input for the first word, so your first suggestion is valid and worked, but as different words get spawned, their names get harder to track.
Basically I'd like a way to "sort" the names automatically as they get spawned and removed.
Something like :
for each "word" scene that gets spawned
first focus on the word closer to the player zone , check if it either hits the player, or get deleted
then focus on the second word, check the same thing
and so on
in a backwards fashion, from the player zone to the spawn zone.
Hope this makes more sense, still trying to wrap my head around all this stuff.
I just thought of (maybe) an array where the word closer to the player would be "item0", and then it gets freed, the second word in the array then becomes "item0", so this way could allow me to write a code to check item0 first and then the rest?
Will try this out when I get home.