Games::Roguelike::Utils - Convenience functions and exports for roguelikes
use Games::Roguelike::Utils qw(:all);
Non-object oriented functions that are generally helpful for roguelike programming, and are used by other roguelike modules.
Returns min/max of 2 passed values
Returns the distance between 2 points, uses Inline C version if available
Randomly sorts its arguments and returns the random array.
With 2 arguments, returns a random integer from a to b, inclusive.
With 1 argument, returns a random integer form 0 to a-1.
Pads string out to length using spaces or "char" if one is specified.
Hash mapping direction names to array ref offsets.
'n' =>[0,-1], # north decreases y, and leaves x alone ... 'se'=>[1, 1], # southeast increases y, and increases x
Array with delta entries as above, sorted as: 'n','s','e','w','ne','se','nw','sw', '.'
The array ('n','s','e','w','ne','se','nw','sw','.')
The array ('n','ne','e','se','s','sw','w','nw'), used in door-ok and other quadrant-scanning algorithms.
Maps 0=>'n', 1=>'s' ... etc. as in @DIRS
Games::Roguelike::World
Erik Aronesty earonesty@cpan.org
earonesty@cpan.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html or the included LICENSE file.
To install Games::Roguelike::Mob, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Roguelike::Mob
CPAN shell
perl -MCPAN -e shell install Games::Roguelike::Mob
For more information on module installation, please visit the detailed CPAN module installation guide.