Android Open Source - Froggy Game Screen






From Project

Back to project page Froggy.

License

The source code is released under:

GNU General Public License

If you think the Android project Froggy listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mopgames.Screens;
/*ww w. j  ava2 s.  c  o  m*/
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.mopgames.GameWorld.GameRenderer;
import com.mopgames.GameWorld.GameWorld;
import com.mopgames.Helpers.InputHandler;

public class GameScreen implements Screen {

  private GameWorld world;
  private GameRenderer renderer;
  private float runTime;

  // This is the constructor, not the class declaration
  public GameScreen() {

    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((int) gameWidth, midPointY);
    Gdx.input.setInputProcessor(new InputHandler(world, screenWidth
        / gameWidth, screenHeight / gameHeight));
    renderer = new GameRenderer(world, (int) gameHeight, midPointY);
    world.setRenderer(renderer);
  }

  @Override
  public void render(float delta) {
    runTime += delta;
    world.update(delta);
    renderer.render(delta, runTime);
  }

  @Override
  public void resize(int width, int height) {
  }

  @Override
  public void show() {
  }

  @Override
  public void hide() {
  }

  @Override
  public void pause() {
  }

  @Override
  public void resume() {
  }

  @Override
  public void dispose() {
  }

}




Java Source Code List

android.UnusedStub.java
com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelper.java
com.mopgames.ActionResolverDesktop.java
com.mopgames.MainActivity.java
com.mopgames.Main.java
com.mopgames.RobovmLauncher.java
com.mopgames.Froggy.FroggyGame.java
com.mopgames.GameObjects.Background.java
com.mopgames.GameObjects.Frog.java
com.mopgames.GameObjects.Lilypad.java
com.mopgames.GameObjects.MenuItem.java
com.mopgames.GameObjects.ScrollHandler.java
com.mopgames.GameObjects.Scrollable.java
com.mopgames.GameWorld.GameRenderer.java
com.mopgames.GameWorld.GameWorld.java
com.mopgames.Helpers.ActionResolver.java
com.mopgames.Helpers.AssetLoader.java
com.mopgames.Helpers.InputHandler.java
com.mopgames.Screens.GameScreen.java
com.mopgames.Screens.SplashScreen.java
com.mopgames.TweenAccessors.SpriteAccessor.java
com.mopgames.TweenAccessors.ValueAccessor.java
com.mopgames.TweenAccessors.Value.java
com.mopgames.client.ActionResolverDesktop.java
com.mopgames.client.GwtLauncher.java
com.mopgames.ui.SimpleButton.java