Permalink
Browse files

Merge pull request #17 from gargaml/master

Fix Pong paddle handlers (y coordinate update).
  • Loading branch information...
Kartik Thakore
Kartik Thakore committed Mar 22, 2017
2 parents 4610b6e + 94fa0d2 commit 5cb7ff1305cbc46902e39319a70437fb56668925
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/05-pong.pod
View
@@ -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
@@ -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

0 comments on commit 5cb7ff1

Please sign in to comment.