package shoot;

import com.jln.ld.GameEntity;
import com.jln.ld.Shared;

import menus.GameMenu;

public abstract class BasicShoot implements GameEntity{

	float x;
	float y;
	float dx;
	float dy;
	boolean destroy = false;
	
	public BasicShoot(float x, float y, float dx, float dy){
		this.x = x;
		this.y = y;
		this.dx = dx;
		this.dy = dy;
	}
	
	@Override
	public void update(GameMenu game) {
		if(!destroy){
			x += dx;
			y += dy;
			if(x>Shared.GAME_WIDTH+16 || x<-16 || y>Shared.GAME_HEIGHT+16 || y <-16){
				destroy = true;
			}
		}
		
	}

	@Override
	public void render(GameMenu game) {
		this.renderShoot(game);
		
	}
	
	public abstract void renderShoot(GameMenu game);

	public boolean isDestroy() {
		return destroy;
	}

	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}
	

		
}
