How about a Tic Tac Toe game where you want to keep track of which square contains what symbol? One option is to have a variable for each square. You could have variables Top-Left, Top-Middle, Top-Right, Middle-Left, Middle-Middle, Middle-Right, Bottom-Left, Bottom-Middle, Bottom-Right. And then if the 'x' player clicks on the symbol called 'Top-Left' I could have an event that sets the variable Top-Left to 'x'. And then if the 'o' player clicks on the symbol called 'Top-Right', I could have an event to set the variable Top-Right to 'o'. Oh, and now I have to test to see if anyone got three in a row. So what are my possibilities?
If Top-Left, Top-Middle, Top-Right are all 'o',
If Top-Left, Top-Middle, Top-Right are all 'x',
etc.
What happens now if I want to make a simple change in logic, or even worse, make a 10x10 tic tac toe game. So many more possibilites, the events would be endless!
OR I can just use an array that is 10x10 and use math to calculate where the player places an 'o' or an 'x'. Let's say the player 'x' clicks position 3,5. And then all I have to say is set Array(3,5) to 'x'.
That's one possible use of it, out of INFINITELY many! The more game development you do, the more uses you'll see of structures such as arrays. Just wait... In fact, the whole JavaScript game engine that Construct runs on is guaranteed to be full of arrays and loops through those arrays, because it has to keep track of several objects and set common properties on all of them. We are lucky that Construct handles all that stuff for us, so that we only have to use arrays for more specific applications.