def interact
  
    #Get time since last interaction.
    elapsed_time = @clock.elapsed_time
    
    self.objects.each do |object|
    
      #Move each object according to its vector.
      begin
        object.move(elapsed_time)
      #Remove misbehaving objects.
      rescue Exception => exception
        puts exception, exception.backtrace
        self.remove_object(object)
        next
      end
      
      #Have all creatures interact with the environment.
      if object.respond_to?(:act)
        begin
          #Have creature act on all GameObjects other than itself.
          object.act(objects.reject{|target| target.equal?(object)})
        #Remove misbehaving objects.
        rescue Exception => exception
          puts exception, exception.backtrace
          self.remove_object(object)
          next
        end
      end
      
    end
    
    #Have all environmental factors interact with environment.
    self.environmental_factors.each do |factor|
      begin
        factor.act(self)
      #Remove misbehaving environmental factors.
      rescue Exception => exception
        self.remove_environmental_factor(factor)
        puts exception, exception.backtrace
        next
      end
    end
      
    #Mark environment as changed.
    changed

    #Alert observers.
    notify_observers(self)
    
  end
def interact
  
    #Get time since last interaction.
    elapsed_time = @clock.elapsed_time
    
    self.objects.each do |object|
    
      #Move each object according to its vector.
      begin
        object.move(elapsed_time)
      #Remove misbehaving objects.
      rescue Exception => exception
        puts exception, exception.backtrace
        self.remove_object(object)
        next
      end
      
      #Have all creatures interact with the environment.
      if object.respond_to?(:act)
        begin
          #Have creature act on all GameObjects other than itself.
          object.act(objects.reject{|target| target.equal?(object)})
        #Remove misbehaving objects.
        rescue Exception => exception
          puts exception, exception.backtrace
          self.remove_object(object)
          next
        end
      end
      
    end
    
    #Have all environmental factors interact with environment.
    self.environmental_factors.each do |factor|
      begin
        factor.act(self)
      #Remove misbehaving environmental factors.
      rescue Exception => exception
        self.remove_environmental_factor(factor)
        puts exception, exception.backtrace
        next
      end
    end
      
    #Mark environment as changed.
    changed

    #Alert observers.
    notify_observers(self)
    
  end
Allow everything in the environment to interact with each other.
Objects are first moved according to their preexisting vectors and the amount of time since the last call.
Then, each GameObject with an act() method is allowed to act on the environment.
Finally, each EnvironmentalFactor is allowed to act on the Environment.