Skip to content

Commit

Permalink
Removed "stop" direction.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpalmer committed Aug 7, 2010
1 parent 85ec110 commit 6e54fae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Games/Maze/SDL/Model.pm
Expand Up @@ -79,7 +79,7 @@ has 'player_y' => (
has 'player_direction' => (
is => 'rw',
isa => 'Games::Maze::SDL::Direction',
default => 'stop',
default => 'south',
);

has 'player_velocity' => (
Expand Down
2 changes: 1 addition & 1 deletion lib/Games/Maze/SDL/Types.pm
Expand Up @@ -4,6 +4,6 @@ package Games::Maze::SDL::Types;

use Moose::Util::TypeConstraints;

enum 'Games::Maze::SDL::Direction' => qw(north south west east stop);
enum 'Games::Maze::SDL::Direction' => qw(north south west east);

no Moose::Util::TypeConstraints;
6 changes: 2 additions & 4 deletions lib/Games/Maze/SDL/View.pm
Expand Up @@ -104,8 +104,6 @@ sub _build_player {

$sprite->sequence( $self->model->player_direction );

$sprite->start;

return $sprite;
}

Expand Down Expand Up @@ -190,8 +188,6 @@ sub draw_maze {
sub draw_player {
my ($self) = @_;

$self->player->sequence('stop') if $self->model->player_velocity == 0;

$self->player->draw( $self->display );
}

Expand Down Expand Up @@ -219,8 +215,10 @@ sub handle_event {
}
elsif ( $event->{type} eq 'player_turned' ) {
$self->player->sequence( $self->model->player_direction );
$self->player->start;
}
elsif ( $event->{type} eq 'player_stopped' ) {
$self->player->reset;
}
}

Expand Down

0 comments on commit 6e54fae

Please sign in to comment.