drose2211 has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I am a complete beginner with Perl and code in general. I was reading the SDL manual and going through the section on how to make Pong. I decided to write each section for myself and try to understand what was happening in each section I ran into a problem in the area where a subroutine is used to render the ball and paddles to the screen. I typed it as shown in the manual but am getting a syntax error at (> . Sorry if this is a stupid question
$app-add_show_handler (> sub { $app->draw_rect( [ 0, 0, $app->w, $app->h ], 0x000000FF ); $app->draw_rect( $ball->{rect}, 0xFF0000FF ); $app->draw_rect( $player1->{paddle}, 0xFF0000FF ); $app->draw_rect( $player2->{paddle}, 0xFF0000FF ); $app->update; } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pong in SDL
by roboticus (Chancellor) on Nov 30, 2017 at 16:55 UTC | |
by choroba (Cardinal) on Nov 30, 2017 at 22:41 UTC | |
by drose2211 (Sexton) on Dec 01, 2017 at 00:01 UTC |