in reply to pong paddles are not going equally fast
New paddle position also depends on $step which is the time slice.
When you press UP-arrow this checks only the 1st condition. When you press DOWN-arrow it checks both conditions. Could that be affecting $step? Ideally no but try print $step and see.
if($event-> key_sym == SDLK_UP){ $player1->{v_y} = -2; } elsif($event->key_sym == SDLK_DOWN){ + $player1->{v_y} = 2; }
bw, bliako
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: pong paddles are not going equally fast
by choroba (Cardinal) on Jul 23, 2020 at 08:23 UTC |
In Section
Seekers of Perl Wisdom