PangZero/TutorialGame.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 39 CC 5 SCAR 28.7
CC
5
Cov
0%
AdvanceGameObjects
30.0
SetChallenge
2.0
SetGameLevel
2.0
CRAP 17.6
1 ##########################################################################
2 package Games::PangZero::TutorialGame;
3 ##########################################################################
4  
5 @ISA = qw(Games::PangZero::ChallengeGame);
6 use strict;
7 use warnings;
8  
9 sub SetChallenge {
10 my ($self, $challenge) = @_;
11
12 $self->{challenge} = $challenge;
13 }
14  
15 sub SetGameLevel {
16 my ($self, $level) = @_;
17  
18 $self->PlayableGameBase::SetGameLevel($level);
19 $self->SpawnChallenge();
20 }
21  
22 sub AdvanceGameObjects {
23 my ($self) = @_;
24  
25 if ($self->{nextlevel}) {
26 $self->{countDown} = 200;
27 delete $self->{nextlevel};
28 }
29 if ($self->{playerspawned}) {
30 $self->SpawnChallenge();
31 $self->{playerspawned} = 0;
32 }
33 if ($self->{countDown}) {
34 if (--$self->{countDown} < 1) {
35 $self->{abortgame} = 1;
36 }
37 }
38 $self->SUPER::AdvanceGameObjects();
39 }
40  
41 1;