Skip to content

Commit

Permalink
Presetup for the body args, so that we can set body type types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Thakore committed Jun 15, 2012
1 parent e36fc1c commit 10f4441
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Avenger/Actor.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ sub new {
my $class = shift; my $class = shift;
my %args = @_; my %args = @_;
my $body_hash = delete $args{body}; my $body_hash = delete $args{body};

$body_hash = $class::pre_setup( $body_hash );
my $body = world->create_body( $body_hash ); my $body = world->create_body( $body_hash );



if(my $v = delete %{$body_hash}{velocity} ) if(my $v = delete %{$body_hash}{velocity} )
{ {
$body->velocity( @$v ) $body->velocity( @$v )
Expand Down
6 changes: 6 additions & 0 deletions lib/Zemmings/Actor/Zemming.pm
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,12 @@
package Zemmings::Actor::Zemming; package Zemmings::Actor::Zemming;
use Avenger::Actor; use Avenger::Actor;


sub pre_setup {
my $args = shift;
$args->{type} = 'dynamic';
return $args;
};

sub setup { sub setup {
my $self = shift; my $self = shift;


Expand Down

0 comments on commit 10f4441

Please sign in to comment.