Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change sprite alpha and position

  • Loading branch information...
commit 388fa0e98be7ec984134432ecb14f7e19fd87793 1 parent 76b5ba1
@jtpalmer authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 week4/lib/Games/ElectricLines.pm
View
4 week4/lib/Games/ElectricLines.pm
@@ -48,10 +48,11 @@ sub _build_sprite {
my ($self) = @_;
my $sprite = SDLx::Sprite::Animated->new(
- rect => SDL::Rect->new( 0, 0, 50, 50 ),
+ rect => SDL::Rect->new( 0, 50, 50, 50 ),
image => File::Spec->catfile( $self->_share_dir, 'plasma.bmp' ),
ticks_per_frame => 2,
);
+ $sprite->alpha_key(0x000000);
$sprite->start();
return $sprite;
}
@@ -95,6 +96,7 @@ sub handle_move {
sub handle_show {
my ( $self, $delta, $app ) = @_;
+ $app->draw_rect( undef, undef );
foreach my $line ( @{ $self->h_lines } ) {
$app->draw_line( @$line, 0xFFFFFFFF );
}
Please sign in to comment.
Something went wrong with that request. Please try again.