Games::RailRoad::Train - a train object


Games-RailRoad documentation  | view source Contained in the Games-RailRoad distribution.

Index


NAME

Top

Games::RailRoad::Train - a train object

VERSION

Top

version 1.101330

DESCRIPTION

Top

This class models a train object that moves on the rails.

ATTRIBUTES

Top

from

The node from where the train is coming (a Games::RailRoad::Vector object).

to

The node where the train is headed (a Games::RailRoad::Vector object).

frac

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

METHODS

Top

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

Create and return a new train object. One can pass a hash reference with the available attributes.

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

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

AUTHOR

Top

  Jerome Quelin

COPYRIGHT AND LICENSE

Top


Games-RailRoad documentation  | view source Contained in the Games-RailRoad distribution.