Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Sprite animation with SDL_perl

by CharlesClarkson (Curate)
on May 05, 2002 at 17:17 UTC ( [id://164154]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub handle_fire {
        my ($new, $x, $y) = @_;
    ...
            $i++;    
        }
    }
    
  2. or download this
        #draw gunshots, possibly add new one
        handle_fire( $fire, $x, $y );
    
  3. or download this
        #draw gunshots, possibly add new one
        $fire_items = handle_fire( $fire, $x, $y, $fire_items );
    
  4. or download this
    my $fire_items;
        .
    ...
            .
            .
    }
    
  5. or download this
    sub handle_fire {
        my ( $new, $x, $y ) = @_;
    ...
            $i++;
        }
    }
    
  6. or download this
    sub handle_fire {
        my ( $new, $x, $y, $fire_items ) = @_;
    ...
        }
        return $fire_items;
    }
    
  7. or download this
        if ( $new ){
            push(@$fire_items, $x.' '.$y);
        }
    
  8. or download this
        if ( $new ){
            push @$fire_items, [$x, $y];
        }
    
  9. or download this
        push @$fire_items, [$x, $y] if $new;
    
  10. or download this
            my ( $xc, $yc ) = split(' ', $$fire_items[$i] );
    
  11. or download this
            my ( $xc, $yc ) = @{ $fire_items[$i] };
    
  12. or download this
            $$fire_items[$i] = join(' ', $xc + 10, $yc );
    
  13. or download this
            $$fire_items[$i] = [$xc + 10, $yc];
    
  14. or download this
        unless ( $xc < $app->width + $images{beam1}->width ) {
            splice( @$fire_items, $i, 1 );
            next;
        }
    
  15. or download this
    sub handle_fire {
        my ( $new, $x, $y, $fire_items ) = @_;
    ...
        push @temp, [$x, $y] if $new;
        return \@temp;
    }
    
  16. or download this
    sub handle_fire {
        my ( $new, $x, $y, $fire_items ) = @_;
    ...
        push @temp, [$x, $y] if $new;
        return \@temp;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164154]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-26 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found