Commit 53aad44b authored by v.tarantik's avatar v.tarantik

#339 Oprava pocitani poharu v pronasledovani

parent f284e773
......@@ -1209,49 +1209,36 @@ public class PronasledovaniActivity extends GameActivity implements IOnSceneTouc
@Override
public int countProgress() {
final MyTime time = new MyTime(gameTime);
switch (getDifficulty()) {
case EASY:
if (time.getHours() <= 0) {
if (time.getMinutes() >= 5) {
return 0;
} else if ((time.getMinutes() >= 2) && (time.getSeconds() >= 40)) {
return 1;
} else if ((time.getMinutes() >= 1) && (time.getSeconds() >= 20)) {
return 2;
} else {
return 3;
}
} else {
if (gameTime >= 300) {
return 0;
} else if (gameTime >= 160) {
return 1;
} else if (gameTime >= 80) {
return 2;
} else {
return 3;
}
case MEDIUM:
if (time.getHours() <= 0) {
if (time.getMinutes() >= 10) {
return 0;
} else if ((time.getMinutes() >= 6) && (time.getSeconds() >= 0)) {
return 1;
} else if ((time.getMinutes() >= 2) && (time.getSeconds() >= 40)) {
return 2;
} else {
return 3;
}
} else {
if (gameTime >= 600) {
return 0;
} else if (gameTime >= 360) {
return 1;
} else if (gameTime >= 160) {
return 2;
} else {
return 3;
}
case HARD:
if (time.getHours() <= 0) {
if ((time.getMinutes() >= 13) && (time.getSeconds() >= 20)) {
return 0;
} else if ((time.getMinutes() >= 7) && (time.getSeconds() >= 40)) {
return 1;
} else if ((time.getMinutes() >= 5) && (time.getSeconds() >= 20)) {
return 2;
} else {
return 3;
}
} else {
if (gameTime >= 800) {
return 0;
} else if (gameTime >= 460) {
return 1;
} else if (gameTime >= 320) {
return 2;
} else {
return 3;
}
}
return 0;
......
......@@ -26,16 +26,6 @@ public class MyTime {
private long minutes;
private long seconds;
public MyTime(long millis) {
setSeconds(millis / 1000);
setDays(TimeUnit.SECONDS.toDays(getSeconds()));
setHours(TimeUnit.SECONDS.toHours(getSeconds()) - (getDays() * 24));
setMinutes(TimeUnit.SECONDS.toMinutes(getSeconds())
- (TimeUnit.SECONDS.toHours(getSeconds()) * 60));
setSeconds(TimeUnit.SECONDS.toSeconds(getSeconds())
- (TimeUnit.SECONDS.toMinutes(getSeconds()) * 60));
}
public MyTime(float secs) {
setSeconds((long) secs);
setDays(TimeUnit.SECONDS.toDays(getSeconds()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment