package com.hexabeast.lasermonster;

import java.util.ArrayList;


public class Monster {
	
	public Eye[] eyes = new Eye[4];
	
	public ArrayList<Laser> lasers;
	
	public int crameoffsetx = 755;
	public int crameoffsety = 407;
	
	public Monster()
	{
		eyes[0] = new Eye(832,595);
		eyes[1] = new Eye(847,683);
		eyes[3] = new Eye(1105,581);
		eyes[2] = new Eye(1090,675);
		
		lasers = new ArrayList<Laser>();
	}
	
	public void draw()
	{
		
		for(int i = 0; i<eyes.length; i++)
		{
			eyes[i].draw(GameScreen.batch);
			
			if(Inputs.instance.mousedown && !GameScreen.end)
			{
				long id = Main.laserSound.play();
				Main.laserSound.setVolume(id, 0.05f);
				lasers.add(new Laser(eyes[i].x+eyes[i].lookAt.x, eyes[i].y+eyes[i].lookAt.y, eyes[i].mouse.x, eyes[i].mouse.y, i*0f));
			}
		}
		
		GameScreen.batch.setColor(1, 1, 1, 1-(GameScreen.health/100));
		GameScreen.batch.draw(Main.texCrame, 755, 407);
		GameScreen.batch.setColor(1, 1, 1, 1);
	}
	
	public void drawLasers()
	{
		for(int i = lasers.size()-1; i>=0; i--)
		{
			lasers.get(i).draw();
			if(lasers.get(i).isDead)lasers.remove(i);
		}
	}

}
