DuckCurses
view release on metacpan or search on metacpan
lib/DuckCurses/level1.pm view on Meta::CPAN
678910111213141516171819202122232425
my
(
$class
,
$x
,
$y
) =
@_
;
my
$self
=
$class
->SUPER::new (
$x
,
$y
);
### add enemies to the entities list
$self
->add_entity(DuckCurses::goon->new(20,10));
$self
->init;
}
sub
update {
my
(
$self
,
$level_timer
) =
@_
;
if
(
my
@units
=
$level_timer
->hms and
@units
[1] >= 0.500) {
$self
->move_left;
return
"ok"
;
}
else
{
return
undef
;
}
}
lib/DuckCurses/level2.pm view on Meta::CPAN
345678910111213141516171819202122sub
new {
my
(
$class
,
$x
,
$y
) =
@_
;
my
$self
=
$class
->SUPER::new (
$x
,
$y
);
$self
->init;
}
sub
update {
my
(
$self
,
$level_timer
) =
@_
;
if
(
my
@units
=
$level_timer
->hms and
@units
[1] >= 0.500) {
$self
->move_left;
return
"ok"
;
}
else
{
return
undef
;
}
}
( run in 0.250 second using v1.01-cache-2.11-cpan-55f5a4728d2 )