This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
package Wheel; | |
use Mouse; | |
has 'x' => ( is => 'ro', isa => 'Int', required => 1 ); | |
has 'y' => ( is => 'ro', isa => 'Int', required => 1 ); | |
has 'size' => ( is => 'ro', isa => 'Int', default => 60 ); | |
has 'color' => ( is => 'rw', default => undef ); | |
has 'visited' => ( is => 'rw', default => undef ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Algorithm::QuadTree; | |
use warnings; | |
use strict; | |
use Carp; | |
our $VERSION = 0.1; | |
1; | |
############################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=pod | |
=head1 NAME Shooter.pl | |
A quick game to demonstrate the new SDL perl api for Toronto Perl Mongers, Feb 25, 2010. | |
=head2 AUTHOR | |
Kartik Thakore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use SDL; | |
use SDL::Events; | |
use SDL::Event; | |
use SDL::Video; | |
SDL::init(SDL_INIT_VIDEO); | |
my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use lib 'lib'; | |
use SDL; | |
use SDL::App; | |
use SDL::Color; | |
use SDL::Event; | |
use SDL::Mixer; | |
use SDL::Rect; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use Data::Dumper; | |
use Readonly; | |
Readonly my $DIRECTION_UP => 0; #rotates blocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct{ | |
Sint16 x, y; | |
Uint16 w, h; | |
} SDL_Rect; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyRect; | |
use base 'SDL::Rect'; | |
sub new { | |
my $class = shift; | |
my $x = shift || 0; | |
my $y = shift || 0; | |
my $w = shift || 0; | |
my $h = shift || 0; | |
my $self = SDL::Rect->new($x, $y, $w, $h); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
# TODO (in this order): | |
# | |
# - why isn't it bliting correctly with transparent sprite background? | |
# | |
# - work with loading background tiles (world map) | |
# |
NewerOlder