public void update(){
		getNextPosition();
		checkTileMapCollision();
		setPosition(xtemp, ytemp);
		
		if(flinching){
			long elapsed = (System.nanoTime() - flinchTimer) / 1000000;
			if(elapsed >  400){
				flinching = false;
			}
		}
		
		if(up && dy == 0){
			up = false;
			down = true;
		} else if((down && dy == 0) || (y >= tm.getHeight() - 40)){
			up = true;
			down = false;
		}
		
		animation.update();
	}