| 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; |