Skip to content

Commit e69b497

Browse files
committed
Added a Tutorial Screen that can be accessed via F1.
Minor tweaking of constants, reducing the flame speed on Math level. Also fixed an OOP level workaround lifecycle leak.
1 parent 58e01d6 commit e69b497

File tree

6 files changed

+70
-1
lines changed

6 files changed

+70
-1
lines changed

android/assets/tutorial.png

353 KB
Loading

core/src/sk/tuke/gamedev/iddqd/tukequest/actors/game/FxFlameMaster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class FxFlameMaster extends FxFlame {
1919
private static final float MAX_INCREASE_OF_MIN_SPEED = 7;
2020
private static final float SCORE_MULTIPLIER_DISTANCE_RATIO = 500;
2121
public static final float SPEED_DECREASE_ON_PLAYER_LOST_LIFE = 1.5f;
22-
public static final float SPEED_DECREASE_ON_MET_TEACHER = 1.0f;
22+
public static final float SPEED_DECREASE_ON_MET_TEACHER = 1.3f;
2323

2424
private float minSpeed = MIN_SPEED_START;
2525
private HUD hud;

core/src/sk/tuke/gamedev/iddqd/tukequest/screens/GameScreen.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import sk.tuke.gamedev.iddqd.tukequest.actors.game.platforms.Platform;
1919
import sk.tuke.gamedev.iddqd.tukequest.actors.game.platforms.PlatformSize;
2020
import sk.tuke.gamedev.iddqd.tukequest.actors.game.player.Player;
21+
import sk.tuke.gamedev.iddqd.tukequest.actors.game.teachers.Poruban;
2122
import sk.tuke.gamedev.iddqd.tukequest.generator.CollectableGenerator;
2223
import sk.tuke.gamedev.iddqd.tukequest.generator.PlatformGenerator;
2324
import sk.tuke.gamedev.iddqd.tukequest.levels.Level;
@@ -83,6 +84,7 @@ protected World initWorld() {
8384
@Override
8485
public void show() {
8586
super.show();
87+
Poruban.isPorubanLevel = false;
8688
ScoreManager.INSTANCE = new ScoreManager();
8789
TaskManager.INSTANCE.removeTimers("difficultyIncrease");
8890
CollectableGenerator.reset();
@@ -156,6 +158,9 @@ public void act() {
156158
getGame().setScreen(new MenuScreen(getGame()));
157159
throw new ScreenFinishedException();
158160
}
161+
if (InputHelper.isHelp()) {
162+
getGame().setScreen(new TutorialScreen(getGame()));
163+
}
159164
}
160165

161166
});

core/src/sk/tuke/gamedev/iddqd/tukequest/screens/MenuScreen.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ private void exitGame() {
8787
Gdx.app.exit();
8888
}
8989

90+
private void showHelp() {
91+
getGame().setScreen(new TutorialScreen(getGame()));
92+
}
93+
9094
@Override
9195
public void render(float delta) {
9296
super.render(delta);
@@ -95,6 +99,8 @@ public void render(float delta) {
9599
runGame();
96100
} else if (InputHelper.isJustExit()) {
97101
exitGame();
102+
} else if (InputHelper.isHelp()) {
103+
showHelp();
98104
}
99105
}
100106

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package sk.tuke.gamedev.iddqd.tukequest.screens;
2+
3+
import com.badlogic.gdx.audio.Music;
4+
import com.badlogic.gdx.graphics.Camera;
5+
import com.badlogic.gdx.graphics.OrthographicCamera;
6+
import com.badlogic.gdx.physics.box2d.World;
7+
import com.badlogic.gdx.utils.viewport.FitViewport;
8+
import com.badlogic.gdx.utils.viewport.Viewport;
9+
import sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame;
10+
import sk.tuke.gamedev.iddqd.tukequest.actors.game.FullScreenImage;
11+
import sk.tuke.gamedev.iddqd.tukequest.util.InputHelper;
12+
import sk.tuke.gamedev.iddqd.tukequest.visual.Animation;
13+
14+
/**
15+
* Created by Steve on 02.05.2017.
16+
*/
17+
public class TutorialScreen extends AbstractScreen {
18+
19+
public static final Animation TUTORIAL = new Animation("tutorial.png");
20+
21+
protected TutorialScreen(TukeQuestGame game) {
22+
super(game, TukeQuestGame.manager.get("audio/music/backgroundmusic.mp3", Music.class));
23+
}
24+
25+
@Override
26+
protected Camera initCamera() {
27+
return new OrthographicCamera();
28+
}
29+
30+
@Override
31+
protected Viewport initViewport(Camera camera) {
32+
return new FitViewport(TukeQuestGame.SCREEN_WIDTH, TukeQuestGame.SCREEN_HEIGHT, camera);
33+
}
34+
35+
@Override
36+
protected World initWorld() {
37+
return null;
38+
}
39+
40+
@Override
41+
public void show() {
42+
super.show();
43+
addActor(new FullScreenImage(TUTORIAL));
44+
}
45+
46+
@Override
47+
public void render(float delta) {
48+
super.render(delta);
49+
if (InputHelper.isJustExit()) {
50+
getGame().setScreen(new MenuScreen(getGame()));
51+
}
52+
}
53+
54+
}

core/src/sk/tuke/gamedev/iddqd/tukequest/util/InputHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@ public static boolean clickWithinBounds(Camera camera, float xMin, float xMax, f
5757
return false;
5858
}
5959

60+
public static boolean isHelp() {
61+
return Gdx.input.isKeyJustPressed(Input.Keys.F1);
62+
}
63+
6064
}

0 commit comments

Comments
 (0)