|
@@ -36,14 +36,14 @@ public class GDInstance {
|
|
|
|
|
|
//TODO: This doesn't work, repair later
|
|
|
public Model getFrameOnPercent(double percent) {
|
|
|
- double usablePercent = percent - start;
|
|
|
+ double usablePercent = percent - (start / 100);
|
|
|
if (usablePercent > 0) {
|
|
|
float max = LevelInfo.getLevel().getMaxPos();
|
|
|
- double pos = max * percent;
|
|
|
double speed = LevelInfo.getLevel().getSpeedAt((float) percent);
|
|
|
- double time = speed / fps;
|
|
|
-
|
|
|
- int frame = (int) (pos / time);
|
|
|
+ //Animation length in second
|
|
|
+ //TODO: MAKE THIS WORK + add a function to convert percentage to time with correct estimation pf speed (
|
|
|
+ double fullTime = (double) animationObject.getFrames().size() / 24;
|
|
|
+ int frame = 0;
|
|
|
if (!(frame > animationObject.getModelFrames().size() - 1)) {
|
|
|
System.out.println(frame);
|
|
|
return animationObject.getModelFrames().get(frame);
|