Permalink
Browse files

This looks better.

  • Loading branch information...
jtpalmer committed Aug 22, 2010
1 parent cc4acbe commit 1fb2ae71e4eb9e11429dcaeee182aac4d8b8a6f3
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Games/Maze/SDL/Model/Player.pm
@@ -156,10 +156,13 @@ sub move {
$v{$dim} *= 0.9;
}
else {
- if ( ( $v{$dim} += $dt * $a{$dim} ) > $self->max_velocity ) {
+ $v{$dim} += $dt * $a{$dim};
+
+ if ( $v{$dim} > $self->max_velocity ) {
$v{$dim} = $self->max_velocity;
}
}
+
$d{$dim} += $dt * $v{$dim};
}

0 comments on commit 1fb2ae7

Please sign in to comment.