Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Another refactoring

  • Loading branch information...
commit 592d959ae99bbcefc2dfd75daa0ef45d6d309d02 1 parent 10a105a
Jeffrey T. Palmer authored
Showing with 3 additions and 11 deletions.
  1. +3 −11 examples/test.pl
14 examples/test.pl
View
@@ -32,17 +32,9 @@
my $key = SDL::Events::get_key_name( $event->key_sym );
- if ( $key eq '1' ) {
- $controller->fps($fps);
- $controller->move_ratio(1);
- }
- elsif ( $key eq '2' ) {
- $controller->fps($fps / 2);
- $controller->move_ratio(2);
- }
- elsif ( $key eq '3' ) {
- $controller->fps($fps / 3);
- $controller->move_ratio(3);
+ if ( $key =~ /^[123]$/ ) {
+ $controller->fps($fps / $key);
+ $controller->move_ratio($key);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.