Randomly generated world?
AA app company
Member Posts: 73
How would you do this and how would you make a limit on how large?
How would you do this and how would you make a limit on how large?
Comments
This is a very open question and you'll have to be more specific in the future with your questions, but I will try to answer it for you anyways.
I'm guessing you don't want it to be a random level like in flappy bird, but more like in stay in line. What you do to create such levels is to create different chunks of the level. You then choose which chunk to spawn basen on a random number. When that one is done, you choose another one and spawn that one.
To set the limit for the level can be done in many ways, maybe create a chunkCount attribute that will increase everytime a new chunk is spawned and create a rule that tells the spawned only to spawn new chunks when chunkCount <= maxChunks.
I hope you understand and that you could start to build your game right away
Your question is too broad. What type of random world are you thinking about?
Random like flappy birds? That's not really a random world, but actors being spawned or respawned in a random sequence.
Random like a rogue-like? That CAN be done on a certain scale by creating tables to define parts of the screen, then randomly choosing one.
for instance, if you define the screen in quadrants, then you can have 6 upper lefts, 6 upper rights, 6 lower lefts and 6 lower rights. you would randomly choose one for each quadrant and draw them - effectively making a "random" level with many combinations.
Or do you mean random like random blocks scatter around the screen? That's pretty easy to do too with a table or a counter and timer combination.
PS - WHY is this in the announce your game forum?
@ImNiklas @ookami007 I mean sorta like Minecraft / terraria I want the ground level to vary and when you go back to the spot its the same as how you left it.