Skip to main content
Known Participant
November 2, 2006
Question

random array

  • November 2, 2006
  • 3 replies
  • 391 views
Hi,

I have a tile based maze game that i want to be able to choose a level at random. The tiles are arranged by script using a 2D array (the standard way to make tiles with script??), so for example one array is called gameOne = [array], gameTwo = [array] etc....

Anyone have any ideas how to go about this?

Any help would be much appreciated.
This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
November 2, 2006
instead of gameOne etc use myMap etc.
Known Participant
November 2, 2006
i think i understand, any chance you could make your answer a bit clearer? Im kind of new to all this tile based stuff...as in i finally understood it today!!

Thanks for your help though...much appreciated.

Thanks.
kglad
Community Expert
Community Expert
November 2, 2006
try:

Known Participant
November 2, 2006
Hi, sorry to be such a dummy....

I have each one of my games in a seperate Array. Im not sure what part of the code i put in 'for' section of the code you suggested. I understand the rest of it but its just the last bit i dont understand.....I have attached my code to make myself clear.

Thanks for you help....

my Arrays look like this..



kglad
Community Expert
Community Expert
November 2, 2006
put your levels in an array and select a random array index.