Jerome Quelin > Games-RailRoad-1.00 > Games::RailRoad::Train

Download:
Games-RailRoad-1.00.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

Games::RailRoad::Train - a train object

DESCRIPTION ^

Games::RailRoad::Train provides a train object.

CONSTRUCTOR ^

my $train = Games::RailRoad::Train->new( \%opts );

Create a new train object. One can pass a hash reference with the following keys:

from => $node

the node from where the train is coming.

to => $node

the node where the train is headed.

frac => $frac

a number between 0 and 1 indicating where exactly the train is between its from and to nodes.

PUBLIC METHODS ^

$train->draw( $canvas, $tilelen );

Request $train to draw itself on $canvas, assuming that each square has a length of $tilelen.

SEE ALSO ^

Games::RailRoad.

AUTHOR ^

Jerome Quelin, <jquelin at cpan.org>

COPYRIGHT & LICENSE ^

Copyright (c) 2008 Jerome Quelin, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.