Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I am trying to create a baseball simulator. One part of it is the roster of players, which I have put into an array. In my capx file, I have two teams with one chosen at random. How can I loop through the array and display the player's uniform number and name who is up to bat? I created a button that once clicked shows 3 outs, indicating the next player's number/name should show up. Thank you for your help!
loop-thru-array.capx
Index = 0
Set Text to Roster.At(index)
Index ++
Something like this should work
I do not know much about baseball...but
but maybe this can help..
capx> http://s000.tinyupload.com/index.php?fi ... 1649361859
Develop games in your browser. Powerful, performant & highly capable.
Thank you, Fireche, for the code, and thank you, korbaach, for the capx file. The file worked exactly as I wanted. Is there an advantage to loading the array data from a JSON string?