Topic was automatically imported from the old Question2Answer platform.
Asked By
Drachenbauer
Hello
I´m working on a sokoban-game:
In the tilemap informations are stored in an array of arrays.
the outer array holds as much inner arrays as my game-screen has tiles in width.
each of the inner arrays has as many positions as my game-screen has tiles in hight.
How can i now find the exact position of a content in this thing?
i want at first a number, in which inner array it is and than the number of the position inside that array.
How do i code this?
The typical way would be to just iterate through the rows and columns with a double for loop looking for the item of interest. Is that not what you want here, or are you unsure how to do that?