Android Open Source - TreeFrogEngine Ouya Game






From Project

Back to project page TreeFrogEngine.

License

The source code is released under:

MIT License

If you think the Android project TreeFrogEngine 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.discretesoftworks.OUYAframework;
/*from   w w  w.jav  a2s. co m*/
import tv.ouya.console.api.OuyaController;
import tv.ouya.console.api.OuyaFacade;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.MotionEvent;

import com.discretesoftworks.framework.AndroidGame;

public abstract class OuyaGame extends AndroidGame{
  
  private String devID;
  
  public OuyaGame(String devID){
    this.devID = devID;
  }
  
  @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Grab and initialice the Ouya Facade
        OuyaFacade facade = OuyaFacade.getInstance();
        facade.init(this, devID);
        
        // Initialize the Ouya Controller
        OuyaController.init(this);
  }
  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
      if (getController() != null && getController().getInit()){
        return getController().onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
      }
      return super.onKeyDown(keyCode, event);
  }
  
  @Override
  public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (getController() != null && getController().getInit()){
      return getController().onKeyUp(keyCode, event) || super.onKeyUp(keyCode, event);
    }
    return super.onKeyUp(keyCode, event);
  }
  
  @Override
    public boolean onGenericMotionEvent(MotionEvent event) {
    if (getController() != null && getController().getInit())
      return getController().onGenericMotionEvent(event) || super.onGenericMotionEvent(event);
        return super.onGenericMotionEvent(event);
    }
  
  
}




Java Source Code List

com.discretesoftworks.OUYAframework.OuyaGameController.java
com.discretesoftworks.OUYAframework.OuyaGame.java
com.discretesoftworks.TestGame.Floor.java
com.discretesoftworks.TestGame.Player.java
com.discretesoftworks.TestGame.Pointer.java
com.discretesoftworks.TestGame.TestController.java
com.discretesoftworks.TestGame.TestGame.java
com.discretesoftworks.framework.AndroidGame.java
com.discretesoftworks.framework.Assets.java
com.discretesoftworks.framework.Directional.java
com.discretesoftworks.framework.GameController.java
com.discretesoftworks.framework.GameFont.java
com.discretesoftworks.framework.GameObject.java
com.discretesoftworks.framework.GameRenderer.java
com.discretesoftworks.framework.GriddedObject.java
com.discretesoftworks.framework.ModelLoader.java
com.discretesoftworks.framework.MovingObject.java
com.discretesoftworks.framework.MyGLRenderer.java
com.discretesoftworks.framework.MyGLSurfaceView.java
com.discretesoftworks.framework.NumericalMatrix.java
com.discretesoftworks.framework.Pair.java
com.discretesoftworks.framework.Path.java
com.discretesoftworks.framework.Pool.java
com.discretesoftworks.framework.RaggedDictionary.java
com.discretesoftworks.framework.RenderModel.java
com.discretesoftworks.framework.Sprite.java
com.discretesoftworks.framework.Terrain.java
com.discretesoftworks.framework.TextDisplay.java
com.discretesoftworks.framework.TextHolder.java
com.discretesoftworks.framework.View.java
com.discretesoftworks.networking.NetworkGameController.java
com.discretesoftworks.networking.Writer.java