Back to project page ZombieBird.
The source code is released under:
Apache License
If you think the Android project ZombieBird listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.kilobolt.Screens; /*w w w .j a va2 s .c o m*/ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.kilobolt.GameWorld.GameRenderer; import com.kilobolt.GameWorld.GameWorld; import com.kilobolt.ZBHelpers.InputHandler; public class GameScreen implements Screen { private GameWorld world; private GameRenderer renderer; private float runTime = 0; public GameScreen() { System.out.println("GameScreen Attached"); float screenWidth = Gdx.graphics.getWidth(); float screenHeight = Gdx.graphics.getHeight(); float gameWidth = 136; float gameHeight = screenHeight / (screenWidth / gameWidth); int midPointY = (int)(gameHeight / 2); world = new GameWorld(midPointY); // initialize world renderer = new GameRenderer(world, (int)gameHeight, midPointY); // initialize renderer Gdx.input.setInputProcessor(new InputHandler(world.getBird())); } @Override public void render(float delta) { runTime += delta; world.update(delta); renderer.render(runTime); } @Override public void resize(int width, int height) { System.out.println("GameScreen - resizing"); } @Override public void show() { System.out.println("GameScreen - show() called"); } @Override public void hide() { System.out.println("GameScreen - hide() called"); } @Override public void pause() { System.out.println("GameScreen - pause() called"); } @Override public void resume() { System.out.println("GameScreen - resume() called"); } @Override public void dispose() { // Leave blank } }