use Carp qw(cluck);
use Data::Dump qw(dump);
+use Airplane;
+our @airplanes;
+
our $debug = 0;
my ( $w, $h ) = ( 800, 480 );
sub { $app->pixel( @_, $path_color ) }
);
}
+ push @airplanes, Airplane->new( $app );
+ $airplanes[-1]->set_path( @path );
$app->sync;
reset_path;
}
sub handle_events {
- while ( $event->wait ) {
+ while ( $event->poll ) {
my $type = $event->type();
if ( $type == SDL_MOUSEBUTTONDOWN() ) {
$app->fill( $rect, $mouse_color );
$app->update( $rect );
$last_x = $x;
- $last_y = $y;
+ $last_y = $y;
} else {
$mouse_down = 0;
curve;
while(1) {
handle_events;
+ $_->draw foreach @airplanes;
+ $app->delay(50);
$app->sync;
- $app->delay(1);
}
1;