package SDL::Game::Rect;
use strict;
use warnings;
-
+use Carp;
use base 'SDL::Rect';
our $VERSION = '0.01';
my $self = $class->SUPER::new($x, $y, $w, $h);
unless ($$self) {
- require Carp;
- Carp::croak SDL::GetError();
+ #require Carp;
+ croak SDL::GetError();
}
bless $self, $class;
return $self;
sub move {
my ($self, $x, $y) = (@_);
if (not defined $x or not defined $y) {
- require Carp;
- Carp::croak "must receive x and y positions as argument";
+ #require Carp;
+ croak "must receive x and y positions as argument";
}
return $self->new(
-top => $self->top + $y,
sub move_ip {
my ($self, $x, $y) = (@_);
if (not defined $x or not defined $y) {
- require Carp;
- Carp::croak "must receive x and y positions as argument";
+ #require Carp;
+ croak "must receive x and y positions as argument";
}
$self->x($self->x + $x);
$self->y($self->y + $y);
sub inflate {
my ($self, $x, $y) = (@_);
if (not defined $x or not defined $y) {
- require Carp;
- Carp::croak "must receive x and y positions as argument";
+ #require Carp;
+ croak "must receive x and y positions as argument";
}
return $self->new(
sub inflate_ip {
my ($self, $x, $y) = (@_);
if (not defined $x or not defined $y) {
- require Carp;
- Carp::croak "must receive x and y positions as argument";
+ #require Carp;
+ croak "must receive x and y positions as argument";
}
$self->x( $self->x - ($x / 2) );