Permalink
Browse files

fixed alternating speed for different directions

  • Loading branch information...
1 parent edba708 commit c6706d4e23bdbfc82036651181e282ab1f2872e4 @FROGGS committed Apr 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 Asteroids/Player.pm
View
@@ -104,8 +104,8 @@ sub move {
my $r = $app->stash->{player}->r;
- $app->stash->{player}->x( $app->stash->{player}->x + sin(deg2rad($r)) * $app->stash->{player}->v_m );
- $app->stash->{player}->y( $app->stash->{player}->y - cos(deg2rad($r)) * $app->stash->{player}->v_m );
+ $app->stash->{player}->x( int($app->stash->{player}->x + sin(deg2rad($r)) * $app->stash->{player}->v_m + 0.5) );
+ $app->stash->{player}->y( int($app->stash->{player}->y - cos(deg2rad($r)) * $app->stash->{player}->v_m + 0.5) );
$app->stash->{player}->x( $app->stash->{player}->x % $app->stash->{field}->w );
$app->stash->{player}->y( $app->stash->{player}->y % $app->stash->{field}->h );

0 comments on commit c6706d4

Please sign in to comment.