
public class PlayerMindControlling extends Entity {

	private Sprite[] framesMindControl = new Sprite[3];
	
	/** The time since the last frame change took place */
	private long lastFrameChange;
	/** The frame duration in milliseconds, i.e. how long any given frame of animation lasts */
	private long frameDuration = 250;
	/** The current frame of animation being displayed */
	private int frameNumber;
	
	public PlayerMindControlling(String ref, Game game, int x, int y, int rx, int ry, int rw, int rh) {
		super(ref, x, y, rx, ry, rw, rh, true); // "sprites/block.png"
		
		framesMindControl[0] = ResourceFactory.get().getSprite("sprites/player/m1.png");
		framesMindControl[1] = ResourceFactory.get().getSprite("sprites/player/m2.png");
		framesMindControl[2] = ResourceFactory.get().getSprite("sprites/player/m3.png");
	}

	public void collidedWith(Entity other) {
		
	}
	
	public void move(long delta) {
		
		lastFrameChange += delta;
		
		if (lastFrameChange > frameDuration) {
				
			lastFrameChange = 0;
			// update the frame
			frameNumber++;
			if (frameNumber >= framesMindControl.length) {
				frameNumber = 0;
			}
			sprite = framesMindControl[frameNumber];
			
		}
	}
}
