public synchronized void update(long time){
		if(frames.size()>1){
			animTime+=time;
			if(animTime>=duration){
				animTime%=duration;
				currentFrame=0;
			}
			
			while(animTime>getFrame(currentFrame).endTime){
				currentFrame++;
			}
		}
	}