I've hacked together a working ladder generation that produces some great results. It's not completely fair though, and I'm still working out the kinks. Right now when I generate all of the platforms I save their position in a list. When I get to ladder generation I iterate through the list to each platform. Then I drop a tracer down from each point on the platform. The longest distance is the position of the ladder for that platform. Ties for distance are chosen between randomly.
This is what is missing currently from ladder generation that I want in:
- Platforms with multiple / no ladders
- Ladders that don't reach all the way to the bottom (I hacked this in to randomly truncate the ladder but want a better way to do it)
Current tileset (not final) applied to a map |
Debug tileset applied to the same map |
Here is an ascii print out of a map with ladder generation.
Key:
- ' ' = empty space
- 'X' = cave wall
- '-' = platform
- '+' = ladder / platform intersection
- 'l' = ladder
No comments:
Post a Comment