PangZero/DemoGame.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 37 CC 3 SCAR 18.4
CC
3
Cov
0%
SpawnBalls
12.0
ResetGame
2.0
SetGameSpeed
2.0
CRAP 6.3
1 ##########################################################################
2 package Games::PangZero::DemoGame;
3 ##########################################################################
4  
5 @ISA = qw(Games::PangZero::PanicGame);
6  
7 sub ResetGame {
8 my $self = shift;
9 Games::PangZero::Config::SetDifficultyLevel(1);
10 Games::PangZero::Config::SetWeaponDuration(0);
11 $Games::PangZero::Slippery = 0;
12 $self->SUPER::ResetGame();
13  
14 my $ball = Games::PangZero::Ball::Create($Games::PangZero::BallDesc[4], 400, 0, -10, 0);
15 $ball->GiveMagic();
16  
17 push @Games::PangZero::GameObjects, (
18 Games::PangZero::Ball::Create($Games::PangZero::BallDesc[0], 100, 0, 1),
19 Games::PangZero::Ball::Create($Games::PangZero::BallDesc{super0}, 300, 0, 0),
20 Games::PangZero::Ball::Create($Games::PangZero::BallDesc{super1}, 500, 0, 1),
21 $ball,
22 );
23 $Games::PangZero::GamePause = 0;
24 $Games::PangZero::GameSpeed = 0.8;
25 $self->{spawndelay} = $self->{superballdelay} = 1000000;
26 $self->{ballcounter} = 0;
27 $self->{balls} = [ qw(b0 h0 w1 quake death seeker) ];
28 }
29  
30 sub SetGameSpeed {
31 $Games::PangZero::GameSpeed = 0.8;
32 }
33  
34 sub SpawnBalls {
35 my $self = shift;
36
37 return if (--$self->{spawndelay} > 0);
38 my $ballName = $self->{balls}->[$self->{ballcounter}];
39 return unless $ballName;
40 push @Games::PangZero::GameObjects, ( Games::PangZero::Ball::Spawn($Games::PangZero::BallDesc{$ballName}, 100, 1, 0) );
41 $self->{spawndelay} = 1000000;
42 ++$self->{ballcounter};
43 }
44  
45 sub RespawnPlayers {}
46 sub OnBallPopped {}
47  
48 1;