#import "bird.h"

@implementation Bird
- (id) initWithLocation:(int) l andWorldSize:(int)sz
{
  self = [super initWithLocation:l andWorldSize:sz];
  return self;
}

- (void) exist
  {
    age++;

  if (age == 10)
    {
      dir = 1;
    }
  else if (age > 15)
    {
      if (loc + dir >= worldSize || loc + dir < 0)
	{
	  dir *= -1;
	}
      loc += dir;
    }
  }

- (NSString *)draw
  {
    if (age < 10)
      {
	return [NSString stringWithCString:"o"];
      }
    else
      {
	return [NSString stringWithCString:"v"];
      }
  }

@end
