Games::Roguelike::Caves - generation of cave levels using cellular automata
use Games::Roguelike::Caves; my $map = generate_cave(50,20); outline_walls ($map); for (@$map){ for (@$_){ print; } print "\n" }
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.
generate_cave outline_walls
Zach M, zpmorgan@gmail.com
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.
To install Games::Roguelike::Caves, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Roguelike::Caves
CPAN shell
perl -MCPAN -e shell install Games::Roguelike::Caves
For more information on module installation, please visit the detailed CPAN module installation guide.