package zero1hd.rhythmbullet.entity.enemies;

import java.util.HashMap;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.utils.Pool.Poolable;

import zero1hd.rhythmbullet.entity.Entity;

public class Pellet extends Entity implements Poolable {
	
	@Override
	public void preInit() {
		sprite = new Sprite(assets.get("pellet.png", Texture.class));
		enemy = true;
		setSize(0.5f, 0.5f);
		sprite.setColor(0.5f, 1f, 1f, 0.5f);
		super.preInit();
	}
	
	public void init(float x, float y, float angle, float rate) {
		setPosition(x, y);
		this.speed = rate;
		this.angle = angle;
	}
	
	/**
	 * Vars: x, y, speed, angle;
	 */
	@Override
	public void init(HashMap<String, Float> params) {
		setPosition(params.get("x"), params.get("y"));
		speed = params.get("speed");
		angle = params.get("angle");
		super.init(params);
	}
	
	@Override
	public void act(float delta) {
		super.act(delta);
	}
	
	@Override
	public void collided(Entity entity) {
		dead = true;
		super.collided(entity);
	}

	@Override
	public void reset() {
		dead = false;
		super.reset();
	}

}
