-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstructionsScreen.java
executable file
·67 lines (48 loc) · 1.48 KB
/
instructionsScreen.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// instructonsScreen.java
// Henry Hu, Nafis Molla
// May 14, 2019
// ICS4U
// Simply displays the instructions screen at the beginning
package com.mygdx.game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class instructionsScreen implements Screen{
private SpriteBatch batch;
private Menu menu;
private Texture instructions;
public instructionsScreen(Menu g){
menu = g;
}
@Override
public void show() {
batch = new SpriteBatch();
instructions = new Texture("instructions.png");
}
@Override
public void render(float delta) {
if (Gdx.input.isKeyPressed(Input.Keys.ESCAPE)){ //escape to go back to the main menu
menu.setScreen(menu.getMenuScreen());
}
batch.begin();
batch.draw(instructions,0,0,Gdx.graphics.getWidth(),Gdx.graphics.getHeight()); //instructions picture
batch.end();
}
@Override
public void resize(int width, int height) {
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void hide() {
}
@Override
public void dispose() {
}
}