Java tutorial
package com.tm4rkus.conquertheempire; /** * Copyright 2011 David Kirchner dpk@dpk.net * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Source: * http://dpk.net/2011/05/08/libgdx-box2d-tiled-maps-full-working-example-part-2/ */ import com.badlogic.gdx.ApplicationListener; public class ConquerTheEmpire implements ApplicationListener { /** * The time the last frame was rendered, used for throttling framerate */ private Game game; public ConquerTheEmpire() { super(); } @Override public void create() { game = new Game(); } @Override public void resume() { } @Override public void render() { switch (State.getState()) { case State.START: game.startScreen.draw(); break; case State.PAUSE: game.pauseScreen.render(); break; case State.NEW_GAME: game.newGameScreen.draw(); break; case State.RUNNING: game.players[0].draw(); break; case State.CREATIVE: game.creativeMapScreen.draw(); break; } } @Override public void resize(int width, int height) { } @Override public void pause() { State.pause(); } @Override public void dispose() { } }