Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LaohuGame extends Game {
- public static final int FRUIT_NUM = 24;
- public static final String WORK_DIR = "Desktop/assets/";
- @Override
- public void create() {
- GameScreen gameScreen = new GameScreen(this);
- setScreen(gameScreen);
- }
- public class GameScreen extends LaohuScreen {
- private final Stage stage;
- public static int START_X = 11;
- public static int START_Y = 199;
- public GameScreen(Game game) {
- super(game);
- stage = new Stage(GAME_WIDTH,GAME_HEIGHT,true);
- //add actors to the stage
- }
- public class LaohuScreen implements Screen{
- int GAME_WIDTH;
- int GAME_HEIGHT;
- protected Game game;
- public LaohuScreen(Game game) {
- this.game = game;
- GAME_WIDTH = Gdx.graphics.getWidth();
- GAME_HEIGHT = Gdx.graphics.getHeight();
- }
- public class LaohuGame extends Game {
- public static final int FRUIT_NUM = 24;
- public static final String WORK_DIR = "Desktop/assets/";
- @Override
- public void create() {
- GameScreen gameScreen = new GameScreen(this);
- setScreen(gameScreen);
- }
- @Override
- public void setScreen(Screen screen) {
- super.setScreen(screen);
- this.getScreen().resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight() * 5 / 10);
- }
- @Override
- public void resize(int width, int height) {
- if (getScreen() != null) getScreen().resize(width, height * 5 / 10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement