public void update(){
		getNextPosition();
		checkTileMapCollision();
		setPosition(xtemp, ytemp);
		
		if(flinching){
			long elapsed = (System.nanoTime() - flinchTimer) / 1000000;
			if(elapsed > 400){
				flinching = false;
			}
		}
		
		if(right && dx == 0){
			right = false;
			left = true;
			facingRight = false;
		} else if(left && dx == 0){
			right = true;
			left = false;
			facingRight = true;
		}
		animation.update();
	}