Game-Marad
view release on metacpan or search on metacpan
KEY:
my ( $ch, $key ) = getchar;
my $action;
if ( defined $key ) {
$action = $key_inputs{$key};
goto KEY unless defined $action;
} elsif ( defined $ch ) {
$action = $ch_inputs{$ch};
goto KEY unless defined $action;
} else {
# nodelay if set will probably need a napms here to avoid busy
# looping through a getchar that then too quickly returns
goto KEY;
}
goto KEY if $action->($app) == NEXT_KEY;
}
}
sub move_west {
my ($app) = @_;
$app->{cursx} -= COLOFF;
( run in 0.260 second using v1.01-cache-2.11-cpan-87723dcf8b7 )