Games-3D

 view release on metacpan or  search on metacpan

lib/Games/3D/Thingy.pm  view on Meta::CPAN

  # link object
  my ($self,$dst,$link) = @_;

  $self->{outputs}->{$link->{id}} = $link;
  $link->add_output($dst);			# from link to $dst
  $dst->add_input($link);
  $link->add_input($self);			# from us to link
  $link;
  }

sub update
  {
  # if thing is going from state A to state B, interpolate values based upon
  # current time tick. If reached state B, disable interpolation, and send a 
  # signal. Return 1 if while still in transit, 0 if target state reached

  my ($self, $tick) = @_;

  # if the thingy is in between two state changes, interpolate between them
  return if $self->{state_endtime} == 0;	# no change neccessary
  

lib/Games/3D/World.pm  view on Meta::CPAN

  }

sub thinkers
  {
  # get count of thinking things
  my ($self) = @_;

  scalar keys %{$self->{think}};
  }

sub update
  {
  my ($self,$now) = @_;

  $self->{time} = $now;				# cache time
  foreach my $id (keys %{$self->{think}})
    {
    my $thing = $self->{think}->{$id};
    if ($thing->{next_think} >= $now)
      {
      $thing->think($now);

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.160 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )