Spelunky-like level generation

TALGames

  • Posts: 35
I want a level generator that isnt completely random, like spelunky. What I mean with this is that each "fragment" of a level has been previously made. So I make 20 fragments, and then with the generator, I make a few random come together to make the level. Is this possible?
There's an ugly chimpanzee in my bathroom and it won't stop yelling the f word

NobodyX

  • *
  • Posts: 1227
Yes.

Use the blocks under Scenes > World > Tiles to edit tiles within the game. You can make the level fragments in the scene designer and then have the game copy them into place.

ceosol

  • *
  • Posts: 2225
What I found helpful with Radical Spectrum Volume 2 was having a spreadsheet made up of the level fragments. This is a tiny example

A1     B1     C1
A2     B2     C2
A3     B3     C3

=A1
=A2
=A3
=B1
=B2
=B3
=C1
=C2
=C3

In each of the spreadsheet cells, put in the TileID number from your tileset. The =A1 through =C3 below will create a list that you can just copy/paste into a text file. Import this text file into a "levelgeneration" list attribute. Then, in the scene behavior:

Repeat (number of items in levelgeneration) times
   Set tile row: column:....... using TileID (get item number "current loop count" from levelgeneration)

The row and column are generated using "floor of" and "remainder of" math blocks based on how big your level fragments are. Since you are checking the levelgeneration list that you made off of the spreadsheet, you can just copy/paste in new lists and it will use the same code automatically.