Добавить обучение и полный экран результата
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.projectsacrifice.game;
|
||||
|
||||
/** Small state machine for the optional, first-run gameplay hints. */
|
||||
public final class OnboardingFlow {
|
||||
public enum Step {
|
||||
MOVEMENT,
|
||||
MULTITOUCH_JUMP,
|
||||
CORPSES_ARE_TOOLS
|
||||
}
|
||||
|
||||
private Step step;
|
||||
private boolean complete;
|
||||
|
||||
private OnboardingFlow(boolean complete) {
|
||||
this.complete = complete;
|
||||
step = Step.MOVEMENT;
|
||||
}
|
||||
|
||||
public static OnboardingFlow firstRun(boolean alreadyComplete) {
|
||||
return new OnboardingFlow(alreadyComplete);
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return !complete;
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
public Step step() {
|
||||
return step;
|
||||
}
|
||||
|
||||
public void next() {
|
||||
if (complete) return;
|
||||
if (step == Step.MOVEMENT) step = Step.MULTITOUCH_JUMP;
|
||||
else if (step == Step.MULTITOUCH_JUMP) step = Step.CORPSES_ARE_TOOLS;
|
||||
else complete = true;
|
||||
}
|
||||
|
||||
public void skip() {
|
||||
complete = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user