lib/Game/HeroesVsAliens/Hero/Pink.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
add_projectile
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Game::HeroesVsAliens::Hero::Pink;
2  
3 use Moo;
4  
5 with 'Game::HeroesVsAliens::Role::Hero';
6  
7 use Game::HeroesVsAliens::Projectile::Pink;
8  
9 has health => (
10 is => 'rw',
11 default => sub { 200 }
12 );
13  
14 has death_sprite => (
15 is => 'rw',
16 default => sub {
17 my $sprite = SDLx::Sprite::Animated->new(
18 image => $_[0]->resource_directory . 'resources/girl-hero-death.png',
19 width => 100,
20 height => 100
21 );
22 return $sprite;
23 }
24 );
25  
26  
27 has idle_sprite => (
28 is => 'rw',
29 default => sub {
30 my $sprite = SDLx::Sprite::Animated->new(
31 image => $_[0]->resource_directory . 'resources/girl-hero-idle.png',
32 width => 100,
33 height => 100,
34 type => 'reverse'
35 );
36 return $sprite;
37 }
38 );
39  
40 has shooting_sprite => (
41 is => 'rw',
42 default => sub {
43 my $sprite = SDLx::Sprite::Animated->new(
44 image => $_[0]->resource_directory . 'resources/girl-hero-shooting.png',
45 width => 100,
46 height => 100,
47 );
48 }
49 );
50  
51 sub add_projectile {
52 my ($self, $app) = @_;
53 $self->projectiles->push(Game::HeroesVsAliens::Projectile::Pink->new({
54 x => $self->x + 70,
55 y => $self->y + 15,
56 }));
57 }
58  
59 1;