NAME
Games::Roguelike::Caves - generation of cave levels using cellular automata
SYNOPSIS
use Games::Roguelike::Caves;
my $map = generate_cave(50,20);
outline_walls ($map);
for (@$map){
for (@$_){
print;
}
print "\n"
}
DESCRIPTION
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
Zach M, zpmorgan@gmail.com
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Zach M
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.