Collision::2D::Entity::Rect - A rectangle entity.
This is an entity with height and width. Attributes (x, y) is one corner of the rect, whereas (x+w,y+h) is the opposite corner.
Width and height of the rectangle.
Anything in Collision::2D::Entity.
See Collision::2D::Entity->collide
print 'boom' if $rect->collide($rect); print 'zing' if $rect->collide($circle); print 'yotz' if $rect->collide($grid);
See Collision::2D::Entity->intersect
print 'bam' if $rect->intersect($rect); # etc..
To install Collision::2D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Collision::2D
CPAN shell
perl -MCPAN -e shell install Collision::2D
For more information on module installation, please visit the detailed CPAN module installation guide.