package edu.wisc.cs.games10.chrononaut;

public abstract class BossEnemy extends Enemy {

	float hspeed = 0.001f; // 1 tile / second
	Level level;
	
	boolean hasChangedDirections;
	
	private java.util.Random randomDirection = new java.util.Random();
	

	@Override
	public void update(float time, Era era) {
		hasChangedDirections = false;
		
		// ai: set velocity when on platform
		int tiley;
		int tilex;
		if (vel.x == 0) {
			tiley = (int) Math.floor(loc.y) + (int) Math.ceil(tileHeight);
			tilex = (int) Math.floor(loc.x);
			if (tiley < level.getHeight() && level.getTile(era, tilex, tiley) == Tile.SOLID) {
				vel.x = randomDirection.nextBoolean() ? hspeed : -hspeed;
			}
		}
		
		// ai: something bossy
	}

}
