Skip to content

Instantly share code, notes, and snippets.

View kthakore's full-sized avatar

Kartik Thakore kthakore

  • San Francisco, California
View GitHub Profile
curl https://api.truevault.com/v1/vaults/12345678-1234-1234-1234-123456789012/documents \
-u [api-key]: \
-X POST \
-d "document=eyJtZXNzYWdlIjoiV2UgbG92ZSB5b3VyIGN1cmlvc2l0eSEgIENvbWUgd29yayB3aXRoIHVzIGFuZCBsZXQncyBnbyBtYWtlIGluc2FuZWx5IGdyZWF0IHByb2R1Y3RzISIsImNvbnRhY3QiOiJoYWNrQHRydWV2YXVsdC5jb20ifQ=="
#!/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)
#
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);
@kthakore
kthakore / Rect struct
Created September 12, 2009 19:03
SDL_Rect
typedef struct{
Sint16 x, y;
Uint16 w, h;
} SDL_Rect;
use strict;
use warnings;
use Data::Dumper;
use Readonly;
Readonly my $DIRECTION_UP => 0; #rotates blocks
#!/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;
#!/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 );
=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
package Algorithm::QuadTree;
use warnings;
use strict;
use Carp;
our $VERSION = 0.1;
1;
###############################
#!/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 );