Skip to content

Commit

Permalink
Merge pull request #17 from gargaml/master
Browse files Browse the repository at this point in the history
Fix Pong paddle handlers (y coordinate update).
  • Loading branch information
Kartik Thakore committed Mar 22, 2017
2 parents 4610b6e + 94fa0d2 commit 5cb7ff1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/05-pong.pod
Expand Up @@ -203,7 +203,7 @@ the motion handlers come in handy:
B<< my $paddle = $player1->{paddle}; >>
B<< my $v_y = $player1->{v_y}; >>

B<< $paddle->y( $paddle->y ( $v_y * $step ) ); >>
B<< $paddle->y($paddle->y + $v_y * $step); >>
B<});>

If you recall previous chapters, the code should be straightforward. When
Expand Down Expand Up @@ -238,7 +238,7 @@ And add another motion handler, just like our player's:
B<< my $paddle = $player2->{paddle}; >>
B<< my $v_y = $player2->{v_y}; >>

B<< $paddle->y( $paddle->y ( $v_y * $step ) ); >>
B<< $paddle->y($paddle->y + $v_y * $step); >>
B<});>

=end programlisting
Expand Down

0 comments on commit 5cb7ff1

Please sign in to comment.