public void update() {
		if (playing) {
			time++;
			if (time > speed) {
				frame++;
				if (frame >= length) {
					if (loop) frame = 0;
					else frame = length - 1;
				}
				time = 0;
			}
		}
	}