Back to project page RockFall-Android.
The source code is released under:
GNU Lesser General Public License
If you think the Android project RockFall-Android 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 eu.raffprta.rockfall.app; /*from w ww . j a va 2s . c om*/ import android.app.*; import android.os.Bundle; import android.util.Log; import android.view.*; import android.content.*; import android.content.pm.ActivityInfo; import eu.raffprta.rockfall.core.entity.Protagonist; public class MainGame extends Activity { private GameCanvas game; private MenuCanvas menu; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Context ctx = getApplicationContext(); // Remove title bar, as it is of no use in the game. requestWindowFeature(Window.FEATURE_NO_TITLE); // Set mode to fullscreen getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // Set game and menu canvas game = new GameCanvas(ctx, this, new GameScreen(ctx.getResources().getDisplayMetrics().widthPixels, ctx.getResources().getDisplayMetrics().heightPixels)); menu = new MenuCanvas(ctx, this, new GameScreen(ctx.getResources().getDisplayMetrics().widthPixels, ctx.getResources().getDisplayMetrics().heightPixels)); setContentView(menu); } public void switchToGame(){ this.finish(); Intent i = new Intent(game.getContext(), GameIntent.class); startActivity(i); } }