Android Open Source - jmjuanesFramework Game Frames






From Project

Back to project page jmjuanesFramework.

License

The source code is released under:

MIT License

If you think the Android project jmjuanesFramework 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 jmjuanes.core;
//from   www . ja  v  a2  s . c o m
import jmjuanes.Config;
import android.util.Log;

public class GameFrames
{
  public static int contador = 0;
  public static int frames = 0;
  public static float tiempo = 0;
  
  public static void Iniciar()
  {
    contador = 0;
    frames = 0;
    tiempo = 0;
  }
  
  public static void SetFrames()
  {
    int ti = (int)((int) Config.LoadTime/1000);
    frames = (int)((int) contador/ti);
    tiempo = (float)((float) 1000/frames);
    Log.i("Frames", "" + frames + " fps");
    Log.i("Tiempo", "" + tiempo + " msg");
  }
  
  public static int GetTime(int fps)
  {
    int t = 0;
    if(frames - fps > 0)
    {
      int sobrantes = frames - fps;
      float t1 = (float)((float) sobrantes*tiempo);
      t1 = (float)((float) t1/fps);
      t = (int)((int) t1);
    }
    
    Log.i("Time for " + fps + "fps", "" + t + " miliseconds");
    return t;
  }
}




Java Source Code List

jmjuanes.Config.java
jmjuanes.GameMain.java
jmjuanes.Screen.java
jmjuanes.core.GameData.java
jmjuanes.core.GameFrames.java
jmjuanes.core.GameLoad.java
jmjuanes.core.GameThread.java
jmjuanes.core.GameTouch.java
jmjuanes.core.GameView.java
jmjuanes.util.Mathm.java
jmjuanes.util.Ui.java