Permalink
Browse files

Set velocity to zero if small enough.

  • Loading branch information...
1 parent 1fb2ae7 commit e9dafc6311d73cde86f4d0d938818044f32b9ee8 @jtpalmer committed Aug 24, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/Games/Maze/SDL/Model/Player.pm
@@ -163,6 +163,10 @@ sub move {
}
}
+ if (abs($v{$dim}) < 1.0e-3) {
+ $v{$dim} = 0;
+ }
+
$d{$dim} += $dt * $v{$dim};
}

0 comments on commit e9dafc6

Please sign in to comment.