Game-PlatformsOfPeril
view release on metacpan or search on metacpan
lib/Game/PlatformsOfPeril.pm view on Meta::CPAN
9869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
or (
$r
== ROWS - 1
and
$LMap
->[
$r
][
$col
][GROUND][WHAT] == FLOOR )
) {
$goal
=
$r
;
last
;
}
}
$Hero
= [
$col
,
$goal
];
}
sub
update_hero {
my
(
$key
,
$ret
);
tcflush( STDIN_FILENO, TCIFLUSH );
while
(1) {
while
(1) {
$key
= ReadKey(0);
last
if
exists
$Key_Commands
{
$key
};
#post_message(sprintf "Illegal command \\%03o", ord $key);
}
$ret
=
$Key_Commands
{
$key
}->();
last
if
$ret
!= MOVE_FAILED;
}
return
$ret
;
}
sub
update_monst {
my
(
$ent
) =
@_
;
my
$mcol
=
$ent
->[LMC][WHERE][PCOL];
my
$mrow
=
$ent
->[LMC][WHERE][PROW];
# prevent monster move where only gravity should apply
# NOTE one may have the clever idea that monsters can run across the
# heads of other monsters though that would require changes to how
# the graph is setup to permit such moves, and additional checks to
# see if something to tread upon is available (and then to let the
# hero do that (like in Lode Runner) or to prevent them from such
( run in 1.049 second using v1.01-cache-2.11-cpan-49f99fa48dc )