import java.awt.Color;

import info.gridworld.actor.Actor;
import info.gridworld.grid.Location;

public class Launcher extends Actor
{
   private int freq;
   private int count;
   
   public Launcher(int freq) 
   { 
      this.freq = freq; 
      count = freq - 1; 
      setColor(Color.RED); 
   }
   
   public void act()
   {
      count++;
      if (count == freq)
      {
         Shuttle s = new Shuttle(2);
         s.putSelfInGrid(getGrid(), getLocation().getNeighborLocation(Location.NORTH));
         count = 0;
      }
   }
}
