Games::PMM - the base distribution of the Paper Maché Monsters Game


Games-PMM documentation Contained in the Games-PMM distribution.

Index


Code Index:

NAME

Top

Games::PMM - the base distribution of the Paper Maché Monsters Game

DESCRIPTION

Top

Paper Maché Monsters is a monster-battling game where wind-up monsters battle each other in an arena. These monsters run through programmable command lists until a victor emerges.

USAGE

Top

Setup

* Create an arena:
  use Games::PMM::Arena;
  my $arena = Games::PMM::Arena->new();

* Create several monsters, giving them command lists:
  use Games::PMM::Monster;

  my @monsters;

  for (0 .. 5)
  {
	my $commands = load_file( "commands.$_" );
	push @monsters, Games::PMM::Monster->new(
		commands => $commands
	);
  }

* Place the monsters within the arena:
  my ($x, $y) = (0, 0);

  for my $monster (@monsters)
  {
 	$arena->add_monster( $monster, x => $x, y => $y ); 	
	$x += 2;
	y  += 2;
  }

* Set the monster facings:
  for my $monster (@monsters)
  {
    my $facing = (qw( north south east west ))[ int( rand( 4 ) ) ];
	$monster->facing( $facing )
  }

* Create an Actions object to dispatch actions:
  use Games::PMM::Actions;

  my $actions = Games::PMM::Actions->new();

Play

Loop through the monsters, activating their command lists:

  for my $monster (@monsters)
  {
	while (my ($action, @arguments) = $monster->next_command())
	{
	    my $command = $actions->can( 'action_' . $action );
		next unless $command;

		$actions->$command( $arena, $monster, @arguments );
	}
  }

Winning

That's up to you. "Last monster standing" is a good winning condition. Of course, some combinations of monsters may never reach each other. Another good option is running the game for a fixed number of rounds, declaring that the least-damaged monster wins.

Ties are acceptable.

AUTHOR

Top

chromatic, chromatic@wgz.org

BUGS

Top

No known bugs.

SEE ALSO

Top

* Games::PMM::Monster::Commands

Documentation on the available commands that monsters understand.

* Games::PMM::Arena

Documentation on the field where monsters fight.

* Games::PMM::Monster

Documentation on the monsters themselves.

* Games::PMM::Actions

Documentation on the implementation of the actions.

COPYRIGHT

Top


Games-PMM documentation Contained in the Games-PMM distribution.

package Games::PMM;

use vars '$VERSION';
$VERSION = '0.10';

1;
__END__