in reply to Movement handlers in SDL
See my reply to your previous post Re: More Pong in SDL.
$paddle->y is a 'getter' method to get the y position of the $paddle object.
$paddle->y(value) is a 'setter' method to set the y position of the $paddle object.
So the code $paddle->y( $paddle->y + ( $v_y * $step ) )increment the y position by the velocity * step
Also there is an error in line 155.
poj#return of $A->left > $B->right; return if $A->left > $B->right;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Movement handlers in SDL
by drose2211 (Sexton) on Dec 05, 2017 at 01:19 UTC |