|
Games::Battleship::Craft - A Battleship craft class |
Games::Battleship::Craft - A Battleship craft class
use Games::Battleship::Craft;
my $craft = Games::Battleship::Craft->new(
id => 'T',
name => 'tug boat',
points => 1,
)
$points_remaining = $craft->hit;
A Games::Battleship::Craft object represents the profile of a
Battleship
Currently, it is required that this be a single uppercase letter (the
first letter of the craft name, probably), since a hit will be
indicated by ``lowercasing'' this mark on a player grid.
Currently, the craft is assumed to have a horizontal or vertical alignment. Soon there will be diagonal positioning...
$points_remaining = $craft->hit;
Increment the craft's hit attribute value and return what's left of
the craft (total point value minus the number of hits).
Have different numbers of different weapons.
Allow a craft to have a width.
Allow diagonal positions too. Why not?
Gene Boggs <gene@cpan.org>
See the Games::Battleship manpage.
|
Games::Battleship::Craft - A Battleship craft class |