Random Map Generator

I’m having hard time to come up with the map generator for this project. Were you guys able to figure it out by yourself or needed extra resource on it?

I am at the same point and at the moment i am doing research on the second option



1 Like

Thanks for the link! I am glad I am not the only one relying outside resources.

Rather than build rectangular areas joined by corridors/doors, I used a slightly modified version of the Game of Life algorithm (from the previous challenge) to create “cave-like” areas. It works by building the rock/walls in an otherwise empty dungeon level, and leaves the empty space as “rooms”.

Can you post your project via link? I am curious to see your results

The top level is Town, where you can buy some adventuring necessities. The caves start at the first level down.

Game here

The code is split into several CodePens:

  1. React components and Sass
  2. Dungeon/Levels
  3. Actor/Player/Town
  4. Monsters
  5. Weapons/Items
  6. Magic

I have a first version
Dungeon random map generator

It brokes very occasionally but at the moment I think it may be worth.
Each refresh (F5) gets a new map.

You can change parameters to achieve different efects and dungeons types.

var dungeon = { cols: 80, rows: 60, ppp: 10, // pixels por unit, square size maxRooms: 40, minSizeRoom: 5, maxSizeRoom: 12, minLenCorridor: 4, maxLenCorridor: 15,

Feedback is welcome

I see that you’ve used in html canvas, which I would say that would make the most sense when it comes to building this particular project.

I am just having trouble understanding what React’s aspects is necessary to build it.