Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpalmer committed Aug 21, 2011
1 parent 592d959 commit 3aaf937
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions examples/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
my $fps = 30;

my $controller = SDLx::Controller::FPS->new(
fps => $fps,
eoq => 1,
fps => $fps,
eoq => 1,
);

my $rect = {
x => 0,
y => 0,
w => 25,
h => 25,
x => 0,
y => 0,
w => 25,
h => 25,
vx => 1,
vy => 1,
};
Expand All @@ -33,7 +33,7 @@
my $key = SDL::Events::get_key_name( $event->key_sym );

if ( $key =~ /^[123]$/ ) {
$controller->fps($fps / $key);
$controller->fps( $fps / $key );
$controller->move_ratio($key);
}
}
Expand All @@ -45,19 +45,19 @@
$rect->{x} += $rect->{vx};
$rect->{y} += $rect->{vy};

if ($rect->{vx} < 0 && $rect->{x} < 0) {
if ( $rect->{vx} < 0 && $rect->{x} < 0 ) {
$rect->{vx} *= -1;
}

if ($rect->{vy} < 0 && $rect->{y} < 0) {
if ( $rect->{vy} < 0 && $rect->{y} < 0 ) {
$rect->{vy} *= -1;
}

if ($rect->{vx} > 0 && $rect->{x} > $app->w - $rect->{w}) {
if ( $rect->{vx} > 0 && $rect->{x} > $app->w - $rect->{w} ) {
$rect->{vx} *= -1;
}

if ($rect->{vy} > 0 && $rect->{y} > $app->h - $rect->{h}) {
if ( $rect->{vy} > 0 && $rect->{y} > $app->h - $rect->{h} ) {
$rect->{vy} *= -1;
}
}
Expand Down

0 comments on commit 3aaf937

Please sign in to comment.