Permalink
Browse files

Presetup for the body args, so that we can set body type types

  • Loading branch information...
1 parent e36fc1c commit 10f44415eb9dd583a3f66befc65ab00d9896dd0c @kthakore committed Jun 15, 2012
Showing with 9 additions and 0 deletions.
  1. +3 −0 lib/Avenger/Actor.pm
  2. +6 −0 lib/Zemmings/Actor/Zemming.pm
View
@@ -19,8 +19,11 @@ sub new {
my $class = shift;
my %args = @_;
my $body_hash = delete $args{body};
+
+ $body_hash = $class::pre_setup( $body_hash );
my $body = world->create_body( $body_hash );
+
if(my $v = delete %{$body_hash}{velocity} )
{
$body->velocity( @$v )
@@ -1,6 +1,12 @@
package Zemmings::Actor::Zemming;
use Avenger::Actor;
+sub pre_setup {
+ my $args = shift;
+ $args->{type} = 'dynamic';
+ return $args;
+};
+
sub setup {
my $self = shift;

0 comments on commit 10f4441

Please sign in to comment.