Games::Roguelike::Caves - generation of cave levels using cellular automata


Games-Roguelike-Caves documentation  | view source Contained in the Games-Roguelike-Caves distribution.

Index


NAME

Top

Games::Roguelike::Caves - generation of cave levels using cellular automata

SYNOPSIS

Top

  use Games::Roguelike::Caves;

  my $map = generate_cave(50,20);
  outline_walls ($map);
  for (@$map){
    for (@$_){
        print;
    }    
    print "\n"
  }

DESCRIPTION

Top

This module provides generation of cave levels using cellular automata. In other words... * Each tile is initialized as a wall or a floor. * Each square's terrain is then reevaluated based upon the number of wall tiles near it. * The previous step is repeated a few times.

outline_walls is included. This replaces walls that border floors with - or |. It could potentially be useful for other level generators, although it is somewhat simple.

EXPORT

 generate_cave
 outline_walls

AUTHOR

Top

Zach M, zpmorgan@gmail.com

COPYRIGHT AND LICENSE

Top


Games-Roguelike-Caves documentation  | view source Contained in the Games-Roguelike-Caves distribution.