
using System;

namespace PlanetExpress.items.enemys.masters
{
	
	
	public class WaveEnemyMaster : BaseEnemyMaster {
				
		public WaveEnemyMaster(EnemyClass enemy) : base(enemy) {
			Wave = GetHashCode()/10000f;				 
		}
		
		float tick = 0f;
		double Wave = 0f;
		bool doShoot = true;
		public override void Action (double timer){
			base.Action (timer);
			
			tick += 10f * (float)timer;
			if ((((int)tick) % 15) == 0) {				
				if (doShoot) Enemy.Shoot();
				doShoot = false;
			} else {
				doShoot = true;	
			}
			
			Wave += 2f * timer;
			Enemy.X += (float)Math.Cos(Wave)/5f;
			Enemy.Y += (float)Math.Sin(Wave);			
		}
	}
}
