DuckCurses

 view release on metacpan or  search on metacpan

lib/DuckCurses/level1.pm  view on Meta::CPAN

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
        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

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
sub 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 )